|
chandu004 wrote: which indicate the state of the other thread
He is talking about different process not different thread.
|
|
|
|
|
|
You should use some synchronization with the help of Mutex.
Check CreateMutex(), WaitForSingleObject() and ReleaseMutex() . You can find many samples in CP that uses mutex.
|
|
|
|
|
Hi all,
i am Encoding media files using WMSDK.As given in SDK Help i am using IWMEncoder interface for encoding. as part of that example
<br />
hr = pEncoder->Start();<br />
<br />
printf("When encoding stops, press a key to close the console window.");<br />
<br />
if ( SUCCEEDED( hr ) )<br />
{<br />
while(!kbhit())<br />
_asm nop;<br />
<br />
hr = pEncoder->Stop();<br />
}<br />
i don't wants to use kbhit() and wants to complete hole file encoing process automatically.
For that we have functions put_Autostop() and get_Autostop() but there are not working properly.
So if anybody has an idea about that give plz.
|
|
|
|
|
when i do write the following:
m_pRecordset->Open("CREATE TABLE MY10151109(ID INT,Hex_Fangwei TEXT,Hex_FuYang TEXT,Hex_QingXie TEXT)",
theApp.m_pConnection.GetInterfacePtr(),
adOpenDynamic,
adLockOptimistic,
adCmdText);
it runs OK;
but when i do it like this:
CString mstr;
mstr.Format("CREATE TABLE '%s'(ID INT,Hex_Fangwei TEXT,Hex_FuYang TEXT,Hex_QingXie TEXT)",TB_Name);
m_pRecordset->Open(mstr.AllocSysString(),
theApp.m_pConnection.GetInterfacePtr(),
adOpenDynamic,
adLockOptimistic,
adCmdText);
appear runtime error
who could tell me why , and what should i do?
wuhuaiji
|
|
|
|
|
nibabug wrote: m_pRecordset->Open(mstr.AllocSysString(),
try putting mstr there and see
i.e. remove .AllocSysString().
AFAIK it should work.
Suggestion to the members:
prefix your main thread subject with [SOLVED] if it is solved.
chandu.
|
|
|
|
|
<br />
void func()<br />
{<br />
struct SInfo SOCKINFO;<br />
SOCKINFO.pThis = this;<br />
SOCKINFO.ClientSocket = sockClient;<br />
strcpy(SOCKINFO.szClientIP, szClientIP);<br />
memset(SOCKINFO.szMessage, 0, BUFFER_SIZE);<br />
hThread = (HANDLE)_beginthreadex(NULL, 0, WorkThread, (LPVOID)&SOCKINFO, 0, NULL);<br />
}<br />
but,when WorkThread() is running,I'm worried about func() have been finished result in "struct SInfo SOCKINFO" be released.That's WorkThread() must be obtain a correct "struct SInfo SOCKINFO"?
UINT CServerSocket::WorkThread(LPVOID pParam)<br />
{<br />
struct SInfo Param;<br />
struct SInfo *lpParam = (struct SInfo*)pParam;<br />
}
-- modified at 23:16 Sunday 14th October, 2007
|
|
|
|
|
Allocate SOCKINFO on the heap and pass its address.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
how to add different Right menu for different area in a MFC UI Procedures,in order to achieve different control and operation.
For example ,A Tree List Control,when I Selecte one type of node ,I want it can Show one type of Right menu ,and if I select another type of node ,I wan it to show another kind of Right menu .
How to achieve it?Please Help me,thank you ~
Work hard. Laugh often. Keep your honor. Never to say never
|
|
|
|
|
You can: 1) create a different context menu at design time and bring up the one you need, or 2) create one context menu at design time and modify it at runtime, or 3) create the whole menu at runtime.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
你可以为每一种邮件添加一个资源菜单,根据不同的item,load相应的resource ID
POINT point;<br />
UINT uFlags;<br />
<br />
GetCursorPos(&point);<br />
<br />
m_ctrlTree.ScreenToClient(&point);<br />
<br />
HTREEITEM hItem = m_ctrlTree.HitTest(point,&uFlags);<br />
<br />
if(hItem)<br />
{<br />
hTreeCurrent = hItem;<br />
ClientToScreen(&point);<br />
<br />
VERIFY(menu.LoadMenu(IDR_TREERCLK));<br />
pPopUp = menu.GetSubMenu(0);<br />
}
|
|
|
|
|
ありがとう
Work hard. Laugh often. Keep your honor. Never to say never
|
|
|
|
|
감사합니다
Work hard. Laugh often. Keep your honor. Never to say never
|
|
|
|
|
I have a dialog template with some control on it.
When I will press a button on this dialog, I want to clone this parent dialog and modied some of its control and display this clone dialog as a modal or modeless. At that point I have two dialog one is the original and another is the clone version with some modification.
I will appreciate your help.
Thank you.
|
|
|
|
|
Can't you just create another dialog template with the modified controls on it?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
My first dialog is resource based. I want to clone it after it is instantiated.
Are you suggested, to get the dialog template of the existing dialog and create indirectly anothe dialog. How I can get the controls and their current status of the first dialog.
Do you have any more idea? Is it possible to implement a copy constructor?
Thank you for your suggestion.
|
|
|
|
|
If you make the Dialog in your resources... Why don't you create a second dialog based on the first but with th modifications you need?
It will be the simplest way, with two different dialogs.
Other solution may be to create the dialog dinamically, derive it from the first one, and add all the controls and modifications you need through code. But I find much easier doing it with just 2 dialogs, and call the one you need when you need.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
s196675m wrote: How I can get the controls and their current status of the first dialog.
GetWindowText() , GetChecked() , GetCurSel() , etc.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Is there any reason I can't take a Snapshot of a suspended process?
It gives me error 299, "Only part of a ReadProcessMemory or WriteProcessMemory request was completed."
Arrgg!
|
|
|
|
|
Independent123 wrote: Is there any reason I can't take a Snapshot of a suspended process?
It gives me error 299...
CreateToolhelp32Snapshot() is producing error 299?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: CreateToolhelp32Snapshot() is producing error 299?
Yes, that's correct. I try to use it to create a snapshot of all the modules in a suspended process, and it gives that error.
However, when I resume the process, there is no error.
EDIT:
I just found the answer: It works by injecting code into the process, so if the process is suspended, it can't function.
|
|
|
|
|
Hello
(It maybe not related to this board, but I'm sure there is many intelligent person they can help me)
I need to know how to use a HTTP proxy server to mack a socket like connection for example for contact a whois server.
thanks you very much
Iman Ghasrfakhri
|
|
|
|
|
You can't. For general purpose socket communication for non-HTTP protocols, you need a SOCKS[^] proxy.
DoEvents : Generating unexpected recursion since 1991
|
|
|
|
|
Hello everyone,
I am developing C++ COM native code (unmanaged C++) using Visual Studio 2005. I do not take any new features of 64-bit platform, and currently my code runs fine on 32-bit platform (e.g. Windows XP SP2).
Now I am researching how to build my code for 64-bit platform (e.g. Windows 2003 Server 64-bit R2)? Any options I need to specify in Visual Studio 2005? The best solution to me is to make a single build for both 32-bit and 64-bit platforms, is that possible?
thanks in advance,
George
|
|
|
|