|
chandu004 wrote: in the example which i have given...
Which is complete overkill, given that two additional threads were suggested. Using SetTimer() is the simplest and most practical solution.
"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
|
|
|
|
|
|
Hi,
I need to programmatically set system folder permissions by using Active Directory Service Interfaces.For this I need ADsSecurity.dll file installed.These files are included with the software development kit (SDK) for Active Directory Service Interfaces 2.5.
Iam Unable to find the relevant link to download the dll.
Can anyone provide me the link to download?
Thanks
-- modified at 2:11 Monday 15th October, 2007
Today is a gift, that's why it is called the present.
|
|
|
|
|
like this:
1.When No.1 process reading a.txt, No.2 process read a.txt simultaneity, both read as usual.
2.When No.1 process reading a.txt, No.2 process write a.txt, No.2 process wait No.1 process read complete then write.
3.When No.1 process writting a.txt, No.2 process read a.txt, No.2 process wait No.1 process write complete then read.
4.When No.1 process writting a.txt, No.2 process write a.txt, No.2 process wait No.1 process write complete then write.
How use _locking (CRT functions) or LockFile , UnlockFile (Window API) finish above. it puzzled me someday. If somebody know, please tell me.Thanks very much.
|
|
|
|
|
use some global flags(may be two or three),
which indicate the state of the other thread.
say for example,
int process1flag=0,process2flag=0;
and make the flag 1 if it is writing and make it 2 if it is reading.
after write or read operations, reset them to 0.
observe the same in the other process and take the decission depending on the flags.
Suggestion to the members:
prefix your main thread subject with [SOLVED] if it is solved.
chandu.
|
|
|
|
|
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!
|
|
|
|