|
abrakadbra wrote: strcpy(db_TQuote.m_MarketState,marketstate);
: error C2664: 'strcpy' : cannot convert parameter 1 from 'unsigned char' to 'char *'
That's because the first parameter being passed to strcpy is of type unsigned char . strcpy expects a signed char* as it's first parameter. You need to cast it to char* for before passing it to strcpy .
The parameter that you are passing is an unsigned char which is dangerous even if you cast it to char* since it's the target for strcpy where the copied string will be placed.
|
|
|
|
|
abrakadbra wrote: strcpy(db_TQuote.m_MarketState,marketstate);
Since db_TQuote.m_MarketState is only one character, and marketstate is likely an array of characters, strcpy() is not the right tool for the job.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
how to recover deleted msg from outlook express.
naveen padiyar
|
|
|
|
|
I am trying to implement a Screen capture program similar to VNC. The issue is
when i use the BitBlt to capture the screen, the cpu goes up to nearly 100% when
the hardware acceleration is set to Full.
I tried this on Couple of machines, on a dell inspiron laptop 6000 it shows abt 60%
but when i run the same on my desktop which has intel chip set and intel video card
the cpu stays 100%. I tried BitBlt on the DC's optained from CreateDIBSection and CreateCompatibleBitmap but did not help.
The Same code Cpu utilisation drops down to 20% - 30% maximum, if the hardware accleration
is set to None
Can anyone please advise me how to minimise the cpu utilisation when hardware acceleration
is set to Full.
If i run the VNC on the same intel machine, it takes only 40% cpu max.
--Vissu.
|
|
|
|
|
I'm not sure about what effect hardware acceleration is having on it, but all the CPU use numbers
sound high. Are you repeatedly capturing the screen in a loop? It seems to me a full screen
capture only when the screen changes would be more efficient.
|
|
|
|
|
I am capturing the screen data only, when there is a change. Even then i
amd getting a 100% cpu utilisation.
Only the task manager in minimised form is running(changing).
Thanks,
- Vissu
|
|
|
|
|
Hi Friends,
I need to invoke a .exe file and pass a message to that file.
Using CreateProcess,I invoked(called) the exe file, FindWindow API to
get the invoked exe and SendMessage to send the message.
The problem is, there is a time delay in CreateProcess that the
FindWindow API cannot find it,if WaitForSingleObject() function is not used.
<br />
CreateProcess("C:\\Bin\\wfp.exe",NULL,0,0,FALSE,CREATE_NEW_CONSOLE,0,0,&si,&pi);<br />
WaitForSingleObject(pi.hThread,500);
CloseHandle(pi.hProcess);<br />
<br />
hExeWnd=FindWindow(NULL,"WFP");<br />
if(hExeWnd)<br />
{<br />
::SendMessage(hExeWnd,WM_PLOTWAVE,0,0);<br />
ShowWindow(hExeWnd,SW_SHOW);<br />
}<br />
The delay time 500ms may vary from machine to machine in accordance with its
performance.If I give it as INFINITE,the program stops there UNTILL the wfp.exe window is CLOSED,which is unacceptable.
So how can I make the program to wait untill the CreateProcess() completes its
task in executing the exe.
NOTE:I tried using ShellExecute API,but there too Sleep() function is needed for the time delay.
|
|
|
|
|
Check out WaitForInputIdle()
|
|
|
|
|
Hey...
WaitForInputIdle() also works,if I specify the delay time as INFINITE.
Great!
Thanks a lot.
Thank you!
|
|
|
|
|
if both parent application and child is urs, u can implement another technique.
Create a named event in both application. The parent application, after calling the createprocess should wait for this event. The child process may set the event to signalled state after initialized.
nave
|
|
|
|
|
Thanks friends!
I cannot use WaitForInputIdle() since it also requires the time delay.
I tried using Naveen's idea of creating events.
It worked!
In the Parent application,I wrote as
<br />
HANDLE hEvent;<br />
hEvent=CreateEvent(NULL,FALSE,FALSE,"WFP_EVENT");
<br />
CreateProcess("C:\\Bin\\wfp.exe",NULL,0,0,FALSE,CREATE_NEW_CONSOLE,0,0,&si,&pi); <br />
<br />
WaitForSingleObject(hEvent,INFINITE); <br />
CloseHandle(pi.hProcess);<br />
CloseHandle(hEvent);<br />
In the child application(i.e the called Exe)
<br />
BOOL CWFPDlg::OnInitDialog()<br />
{<br />
...<br />
HANDLE hEvent;<br />
hEvent=CreateEvent(NULL,FALSE,FALSE,"WFP_EVENT"); <br />
if(GetLastError()==ERROR_ALREADY_EXISTS)<br />
{<br />
hEvent=OpenEvent(EVENT_MODIFY_STATE,FALSE,"WFP_EVENT");<br />
SetEvent(hEvent);
}<br />
...<br />
}<br />
|
|
|
|
|
poda123 wrote: if(GetLastError()==ERROR_ALREADY_EXISTS)
{
hEvent=OpenEvent(EVENT_MODIFY_STATE,FALSE,"WFP_EVENT");
why r u openeing the event again. u already have the handle of the event?I think u can skip that line..
nave
|
|
|
|
|
|
Hi All,
I'm having trouble finding defines for Clipboard Formats. The unknowns appear after Microsoft Word places a gif on the Clipboard. Has anyone been able come across the meaining of:
49251
49298
46289
49158
49159
Jeff
#include <windows.h>
int main(int argc, char* argv[])
{
int count = CountClipboardFormats();
cout << count << _T(" formats available on the clipboard:") << endl << endl;
if( TRUE == OpenClipboard( NULL ) )
{
UINT format = 0;
while( 0 != (format = EnumClipboardFormats( format ) ) )
{
switch( format )
{
case CF_BITMAP:
cout << _T(" CF_BITMAP") << endl;
break;
case CF_DIB:
cout << _T(" CF_DIB") << endl;
break;
case CF_DIBV5:
cout << _T(" CF_DIBV5") << endl;
break;
case CF_DIF:
cout << _T(" CF_DIF") << endl;
break;
case CF_DSPBITMAP:
cout << _T(" CF_DSPBITMAP") << endl;
break;
case CF_DSPENHMETAFILE:
cout << _T(" CF_DIB") << endl;
break;
case CF_DSPMETAFILEPICT:
cout << _T(" CF_DSPMETAFILEPICT") << endl;
break;
case CF_DSPTEXT:
cout << _T(" CF_DSPTEXT") << endl;
break;
case CF_ENHMETAFILE:
cout << _T(" CF_ENHMETAFILE") << endl;
break;
case CF_HDROP:
cout << _T(" CF_HDROP") << endl;
break;
case CF_LOCALE:
cout << _T(" CF_LOCALE") << endl;
break;
case CF_METAFILEPICT:
cout << _T(" CF_METAFILEPICT") << endl;
break;
case CF_OEMTEXT:
cout << _T(" CF_OEMTEXT") << endl;
break;
case CF_PALETTE:
cout << _T(" CF_PALETTE") << endl;
break;
case CF_PENDATA:
cout << _T(" CF_PENDATA") << endl;
break;
case CF_RIFF:
cout << _T(" CF_RIFF") << endl;
break;
case CF_SYLK:
cout << _T(" CF_SYLK") << endl;
break;
case CF_TEXT:
cout << _T(" CF_TEXT") << endl;
break;
case CF_WAVE:
cout << _T(" CF_OWNERDISPLAY") << endl;
break;
case CF_TIFF:
cout << _T(" CF_TIFF") << endl;
break;
case CF_UNICODETEXT:
cout << _T(" CF_UNICODETEXT") << endl;
break;
case 49161:
cout << _T(" Data Object") << endl;
break;
case 49166:
cout << _T(" Object Descriptor") << endl;
break;
case 49272:
cout << _T(" Rich Text Format") << endl;
break;
case 49457:
cout << _T(" HTML Format") << endl;
break;
case 49163:
cout << _T(" Embed Source") << endl;
break;
case 49156:
cout << _T(" Native") << endl;
break;
case 49155:
cout << _T(" OwnerLink") << endl;
break;
case 49167:
cout << _T(" Link Source Descriptor") << endl;
break;
case 49154:
cout << _T(" ObjectLink") << endl;
break;
case 49545:
cout << _T(" Hyperlink") << endl;
break;
case 49171:
cout << _T(" Ole Private Data") << endl;
break;
default:
if( format >= CF_GDIOBJFIRST && format <= CF_GDIOBJLAST )
{
cout << _T(" CF_GDIOBJFIRST + ") << format - CF_GDIOBJFIRST << endl;
} else
if( format >= CF_PRIVATEFIRST && format <= CF_PRIVATELAST )
{
cout << _T(" CF_PRIVATEFIRST + ") << format - CF_PRIVATEFIRST << endl;
} else
{
cout << _T(" Format: ") << format << endl;
}
break;
}
}
CloseClipboard( );
}
return 0;
}
|
|
|
|
|
An app can put pretty much any data it wants to on the clipboard, the numbers won't always be the same from one session to the next. You can call GetClipboardFormatName() to get the string that was originally passed to RegisterClipboardFormat() .
|
|
|
|
|
Hi Mike,
Thanks. That was it.
Jeff
Format: 49161 (DataObject)
Format: 49166 (Object Descriptor)
Format: 49239 (Rich Text Format)
Format: 49297 (HTML Format)
CF_ENHMETAFILE
CF_METAFILEPICT
Format: 49345 (PNG)
Format: 49589 (GIF)
Format: 49346 (JFIF)
Format: 49592 (PNG+Office Art)
Format: 49590 (GIF+Office Art)
Format: 49591 (JFIF+Office Art)
Format: 49586 (Office Drawing Shape Format)
Format: 49594 (ActiveClipboard)
CF_DIB
CF_BITMAP
Format: 49163 (Embed Source)
Format: 49156 (Native)
Format: 49155 (OwnerLink)
Format: 49165 (Link Source)
Format: 49167 (Link Source Descriptor)
Format: 49154 (ObjectLink)
Format: 49171 (Ole Private Data)
CF_DIBV5
|
|
|
|
|
In case anyone is interested in the code...
#include <windows.h>
int main(int argc, char* argv[])
{
int count = CountClipboardFormats();
cout << count << _T(" formats available on the clipboard:") << endl << endl;
if( TRUE == OpenClipboard( NULL ) )
{
UINT format = 0;
while( 0 != (format = EnumClipboardFormats( format ) ) )
{
switch( format )
{
case CF_BITMAP:
cout << _T(" CF_BITMAP") << endl;
break;
case CF_DIB:
cout << _T(" CF_DIB") << endl;
break;
case CF_DIBV5:
cout << _T(" CF_DIBV5") << endl;
break;
case CF_DIF:
cout << _T(" CF_DIF") << endl;
break;
case CF_DSPBITMAP:
cout << _T(" CF_DSPBITMAP") << endl;
break;
case CF_DSPENHMETAFILE:
cout << _T(" CF_DIB") << endl;
break;
case CF_DSPMETAFILEPICT:
cout << _T(" CF_DSPMETAFILEPICT") << endl;
break;
case CF_DSPTEXT:
cout << _T(" CF_DSPTEXT") << endl;
break;
case CF_ENHMETAFILE:
cout << _T(" CF_ENHMETAFILE") << endl;
break;
case CF_HDROP:
cout << _T(" CF_HDROP") << endl;
break;
case CF_LOCALE:
cout << _T(" CF_LOCALE") << endl;
break;
case CF_METAFILEPICT:
cout << _T(" CF_METAFILEPICT") << endl;
break;
case CF_OEMTEXT:
cout << _T(" CF_OEMTEXT") << endl;
break;
case CF_PALETTE:
cout << _T(" CF_PALETTE") << endl;
break;
case CF_PENDATA:
cout << _T(" CF_PENDATA") << endl;
break;
case CF_RIFF:
cout << _T(" CF_RIFF") << endl;
break;
case CF_SYLK:
cout << _T(" CF_SYLK") << endl;
break;
case CF_TEXT:
cout << _T(" CF_TEXT") << endl;
break;
case CF_WAVE:
cout << _T(" CF_OWNERDISPLAY") << endl;
break;
case CF_TIFF:
cout << _T(" CF_TIFF") << endl;
break;
case CF_UNICODETEXT:
cout << _T(" CF_UNICODETEXT") << endl;
break;
default:
if( format >= CF_GDIOBJFIRST && format <= CF_GDIOBJLAST )
{
cout << _T(" CF_GDIOBJFIRST + ") << format - CF_GDIOBJFIRST << endl;
}
else
if( format >= CF_PRIVATEFIRST && format <= CF_PRIVATELAST )
{
cout << _T(" CF_PRIVATEFIRST + ") << format - CF_PRIVATEFIRST << endl;
}
else
{
cout << _T(" Format: ") << format;
TCHAR FormatName[ MAX_PATH + 1 ];
if( 0 != GetClipboardFormatName( format, FormatName, MAX_PATH ) )
{
cout << _T(" (") << FormatName << _T(")");
}
cout << endl;
}
break;
}
}
CloseClipboard( );
}
return 0;
}
|
|
|
|
|
|
I would like to know which function will be called when drop the document file created in multiple document application on exe file icon.
Thanks & Regards,
Suman
|
|
|
|
|
No single function is called. The OS runs the EXE and passes full path to the file on the command line.
|
|
|
|
|
Is it possible to get the command line path? Because, I want to initialize some variables.
Thanks & Regards,
Suman
|
|
|
|
|
It's a parameter to WinMain(), or you can call GetCommandLine()
|
|
|
|
|
Thank you very much for great help!
Thanks & Regards,
Suman
|
|
|
|
|
Hi~!!
I'am Korean. Not Use English. So I can't English well.
I have problem. like subject.
i need to setting Mixer.(MFC Programing)
but i don't know how setting Front Mic in coding.
each computer are different. one thing in inline-list, otherwise anoter in mic-volume.
so it is hard to solve. my word is diffent to setting Front-Mic.
Help me. please.
d
|
|
|
|
|
My program generates the message
"Windows has triggered a breakpoint in your application. This may be due to corruption of the heap, and indicates a bug in the application or any of the dll's it has loaded...."
The question is, there are no memory leaks, so what kinds of misbehavior cause this?
--------------------------------
"All that is necessary for the forces of evil to win in the world is for enough good men to do nothing" -- Edmund Burke
|
|
|
|