|
hello Frndz,
I am using oracle database for my application... in which i wanted to check that database was corrupted or not before my application get started ... kindly give me idea about it..
thanks in advanced...
|
|
|
|
|
I am not sure what this has to do with C++; I suggest you move it to the Database forum.
The best things in life are not things.
|
|
|
|
|
Does Oracle expose an API that you can use for this?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
I wouldn't think that was generally possible.
It also depends on what "corrupted" means.
And for a small database I wouldn't think the cost (time to implement) wouldn't be worth it for the product and for a large database it would not only take a long time but I wonder what the app is going to do then?
|
|
|
|
|
According to MSDN, using SetProcessDefaultLayout(LAYOUT_RTL) should change the layout to right-to-left. However, it does not change the window caption - the buttons are still on the right.
I have found that using the extended style WS_EX_LAYOUTRTL does move the caption buttons to the left.
Is this how SetProcessDefaultLayout() is supposed to work? Or is there another API that will move the caption buttons to the left?
While WS_EX_LAYOUTRTL does work, it means that each window creation has to be intercepted and this flag added. I was hoping to find some way to do it only once, when an app starts.
Thanks for any suggestions.
|
|
|
|
|
Read this[^] and see if it works for you.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
Thanks for that link, but as I said, SetProcessDefaultLayout() doesn't have the same effect as WS_EX_LAYOUTRTL , which Chen fails to mention.
|
|
|
|
|
I know,, i was referring to the other method, some special chars in the varsion string or something alike. Did you try that too?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
Anyways, you could try hooking CreateWindow for your application OR register a windows hook for your process and catch the WM_CREATE message and try to add the WS_EX_LAYOUTRTL flag to created windows using ModifyStyleEx (don't know if it can be modified at runtime).
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
Hello everyone,
I've been experimenting with C++ and how to build a form with it (without MFC).
I've created two buttons at runtime with the following code:
(I used a bit of copying and pasting)
if (button1 == NULL)
{
button1 = ::CreateWindowEx(WS_EX_LEFT,L"button",L"Button1", WS_CHILD ,50,50,50,50,parent,NULL,::GetModuleHandle(NULL),NULL);
SendMessage(button1, WM_SETFONT, (WPARAM)defFont, MAKELPARAM(TRUE, 0));
::ShowWindow(button1,SW_SHOW);
}
if (button2 == NULL)
{
button2 = ::CreateWindowEx(WS_EX_LEFT,L"button",L"Button2", WS_CHILD ,125,50,50,50,parent,NULL,::GetModuleHandle(NULL),NULL);
SendMessage(button2, WM_SETFONT, (WPARAM)defFont, MAKELPARAM(TRUE, 0));
::ShowWindow(button2,SW_SHOW);
}
There's no problem with building the buttons, this is my WndProc:
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case SW_SHOW:
break;
case WM_COMMAND:
if (wParam == BN_CLICKED)
{
Triggered(L"1"); }
break;
case WM_SHOWWINDOW:
Init(hwnd); break;
case WM_CLOSE:
DestroyWindow(hwnd);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hwnd, msg, wParam, lParam);
}
return 0;
}
How can I tell which one sent the message?
--
Nevermind, got it.
lParam equals with the (LPARAM)handle of the button that sent it.
modified on Tuesday, June 7, 2011 3:05 PM
|
|
|
|
|
When you call CreateWindowEx, the return is a handle to the button, that same handle can be used within the WPARAM or LPARAM to distinguish, or alternatively, if you have two button and you must distinguish, then they should probably be sending different messages.
|
|
|
|
|
Another way is to create button window with id.
button1 = ::CreateWindowEx(WS_EX_LEFT,L"button",L"Button1", WS_CHILD ,50,50,50,50,parent,(HMENU)100,::GetModuleHandle(NULL),NULL);
button2 = ::CreateWindowEx(WS_EX_LEFT,L"button",L"Button2", WS_CHILD ,125,50,50,50,parent,(HMENU)200,::GetModuleHandle(NULL),NULL);
Now you can distinguish which is which.
case WM_COMMAND:
if ((UINT)HIWORD(wParam) == BN_CLICKED)
{
switch (int)LOWORD(wParam):
{
case 100:
Triggered(L"1"); //Shows a messagebox.
break;
case 200:
Triggered(L"2"); //Shows a messagebox.
break;
}
}
break;
|
|
|
|
|
How can I get the title of this window and ensure it has certain specific text in it, to separate it from other notepad windows like it in C sharp? I have a program I'm trying to send controls to and the controls differ depending on the title and text of the window. I was using a DLL add on that will not function correctly in win7 because of the different way some GUI windows are drawn, so I wanted to make the entire app .net native.
Thanks for reading.
http://img683.imageshack.us/img683/3281/testgui1.jpg[^]
|
|
|
|
|
Post in C# forum... this is C/C++/MFC
|
|
|
|
|
My apologies, I clicked on the wrong link
|
|
|
|
|
I've done that in the past too, no worries... but you'll probably get better help over there... 
|
|
|
|
|
Hi All,
The Api LoadInstanceString(..) is Failed it is giving an Empty String in Windows7 Operating system.
code.
-----
CString strTemp;
::LoadInstanceString(IDS_MSG_NODBQLPLANS, strTemp);
AfxMessageBox(strTemp);
Help me out.
Thanks & Regards,
uday
|
|
|
|
|
I cannot find any reference to LoadInstanceString() in MSDN, is this a standard part of the Windows API?
The best things in life are not things.
|
|
|
|
|
Hi,
I am Sorry
::LoadString(HINSTANCE hInst,UINT uid,LPWSTR,int len) Api is been Failed.
Code
----
_TCHAR buffer[2048];
LoadString(h, nResId, buffer, 2048); ---> Here the Code is been Failed for Windows7 O.S.
strMsg.Format(_T("%s"),buffer);
help me out.
Thanks & Regards,
uday.
modified on Tuesday, June 7, 2011 6:48 AM
|
|
|
|
|
Hi,
try to call GetLastError() and take a look to the error, can be usefull.
|
|
|
|
|
_TCHAR buffer[2048];
LoadString(h, nResId, buffer, 2048);
strMsg.Format(_T("%s"),buffer);
While i was running the application in WindowXP the Api is Working.
But when it is Window7 O.S the buffer is Empty.
There is no error.
Thanks
uday
|
|
|
|
|
janaswamy uday wrote: There is no error.
So LoadString() is returning a non-zero value?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
I have just tried that and it works fine. Use the debugger to step through your code and check the values of all your parameters to see why it is failing.
The best things in life are not things.
|
|
|
|
|
janaswamy uday wrote: I am Sorry
::LoadString
A suggestion: when adding code to your question use copy and paste so the exact code from your program shows in the question.
The best things in life are not things.
|
|
|
|
|
I saw the following question as an interview question on one of the sites, Can anyone see if I answered correctly? Thanks
bool Item::SetInt( INT_STAT key, int val, UpdateType update )
{
m_Something->SetInt( key, val );
int i;
bool retval;
byte* buffer = new byte[ 256 ];
if ( update & No_UpdateType == No_UpdateType )
{
return false;
}
if ( update & Private_UpdateType == Private_UpdateType )
{
for ( i = 0; i < m_numEvents; ++i )
{
if ( m_eventFilter[i] == key )
{
retval = true;
}
else
{
retval = false;
}
}
if ( retval ) {
SendPrivateEvent( buffer, key, val );
}
}
if ( update & Public_UpdateType == Public_UpdateType )
{
for ( i = 0; i < m_numEvents; ++i )
{
if ( m_eventFilter[i] == key )
{
retval = true;
}
else
{
retval = false;
}
}
if ( retval )
{
SendPublicEvent( buffer, key, val );
}
}
delete buffer;
return retval;
}
My Answers:
|
|
|
|
|