|
Hi,
Can anyone kindly show me some sample code how to execute Oracle stored procedure in Vc++?
|
|
|
|
|
I'm not an expert in DB related thing but still
You can use SQLExecute function[^] execute stored procedure
Please check ODBC API reference[^]
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
|
|
My application is in system tray, how can I post a messsage to it.
I think first I have to obtained the HWND of window but I am unable to do it.
Yesterday I asked the same question but could not get any asnwer.
I have tried with FindWindow(),EnumWindow() but not succed to find the window handle that is in system tray.
Can anybody help me?
|
|
|
|
|
See yesterday also I told you FindWindow and FindWindowEx work fine for my application which minimized to system tray. So the problem you are facing must be due to the way you are minimizing to system tray. Can you share are are you doing that?
-Saurabh
|
|
|
|
|
Sure, My code is like
m_TrayIcon.MinimizeToTray(this);
m_TrayIcon.MaximizeFromTray(this);
I am using 3rd party class to minimize the application
|
|
|
|
|
Well then the question becomes, "How does the 3rd party library minimize the application?" Can you find the window before it's minimized?
Steve
|
|
|
|
|
Just from name of variable I cannot figure about how class is implemented. Can you tell more about implementation about the class?
-Saurabh
|
|
|
|
|
ok, Let me minimise the application with my own code then I will back to you.
Thanks .
|
|
|
|
|
Is the window pointed to by this an MFC window? If so why not use code this this:
pWnd->PostMessage(WM_???, ?, ?);
Steve
|
|
|
|
|
pther wrote: My application is in system tray, how can I post a messsage to it.
The same as you would for any other window. The fact that it is in the taskbar notification area is irrelevant.
pther wrote: Yesterday I asked the same question but could not get any asnwer.
You did get answers. If those answers were not helpful, why would you think asking the same question again would produce anything different?
Have you tried creating a test application that does nothing but minimize itself to the "system tray" without the help of other code or libraries?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
See is this[^] helpfuls for you?
|
|
|
|
|
hi all,
I want to create a module that play a alarm sound such as "bip" on a server whenever connection down.
Many computers, esp servers, don't have sound card. However, they have a mono-speaker inside that make it able to emit simple sound (like the "bip" you hear when you start the computer).
I'm looking for a command to play similar sound in visual C++ without the need of a sound card.
Can anyone help ?
|
|
|
|
|
|
Thanks, it works very well
Also, for anyone who could be interested: we could use a simple function to check if sound card exists and then switch between using Beep() or PlaySound()
BOOL m_bIsSoundCardExist = (waveOutGetNumDevs() > 0);
|
|
|
|
|
You are welcome. Thanks for the tip.
-Saurabh
|
|
|
|
|
|
Using C++ and MFC - is it possible to display an MDI Child window outside of it's MDI Parent - sort of like a modeless dialog?
I know it's goofy - but it is the quick solution to a requirement for a legacy application...
|
|
|
|
|
Have you tried setting the child frame's owner and/or parent to the desktop instead?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I've tried putting the following code in the MainFrame, the MDIChildWnd and the View with no luck:
CWnd* prnt = (CWnd*)::GetDesktopWindow();
if(prnt)
this->SetParent(prnt);
The actual create code is buried in the MFC DocView architecture somewhere - I don't know what method can be overriden to try to pass in the desktop window as the parent.
Maybe someone can help with that?
|
|
|
|
|
This is just a guess, but usually a parent window will clip any child window. Possibly you need to override the PreCreate of the MDI Parent and change it's attributes so as not to clip children.
|
|
|
|
|
Hi everybody.
I have a problem with Serial Communication in MFC. My program could not open serial port and the error is INVALID_HANDLE_VALUE. But if I open the Hyper Terminal program before opening my program, my code is running and I had succeed open port and read port operations. I can't understand this situation.
Thanks in advance...
Port settings are like these (These are parameters)
Baud Rate : 9600
Parity : Even
Stop Bits : 1
Data Bits : 7
And the scale is connected COM1 port to the computer.
My simple code is below as:
////////////////////////////
dcb.DCBlength=sizeof(DCB);
dcb.BaudRate=(unsigned long)atol(m_sBaudRate);
if ( m_sParity.Compare("None") == 0 )
dcb.Parity = NOPARITY;
else
if ( m_sParity.Compare("Even") == 0 )
dcb.Parity = EVENPARITY;
else
if ( m_sParity.Compare("Odd") == 0 )
dcb.Parity = ODDPARITY;
else
dcb.Parity = NOPARITY;
.........
.........
hComm = CreateFile(m_sCOM /*COM1*/,
GENERIC_READ | GENERIC_WRITE,
0,
/* comm devices must be opened w/exclusive-access */ NULL,
/* no security attrs */ OPEN_EXISTING,
/* comm devices must use OPEN_EXISTING */ 0,
/* not overlapped I/O */ NULL /* hTemplate must be NULL for comm devices */ );
if (hComm == INVALID_HANDLE_VALUE)
{
AfxMessageBox("Port not opened!");
}
..............................
..............................
ReadData(m_sResults);
///////////////////////////////////////////////////////////
|
|
|
|
|
Why are you setting DCB values before actually open the communication port?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
I tried to set DCB properties after calling CreateFile(..) method but it didn't work.
|
|
|
|