|
|
This is the problem with UpdateData() . If not used 100% correctly, it causes more problems than it solves.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I discover that if i push twice in the radio button it works. i thinks that is because when you change the radio button it dont reload the new values so if you pick twice in the same radio button satrt to work.
Any ideas to solve this???
|
|
|
|
|
How you r reading the values of the radio button, and which event you have trapped, is it double click.
http://www.priyank.in/
|
|
|
|
|
Is it possible to create an Event within a Service (running under LocalSystem), and then signal that same event from another process (i.e. a normal process)?
I tried setting the security descriptor for the event to enable 'all access' to 'everyone', but it doesn't seem to work - GetLastError returns '5: access is denied'.
Is it the case that the event object is exclusively reserved for the service?
|
|
|
|
|
1. Yes, you can.
2. Perhaps you created the security data incorrectly.
3. No - we do this all the time.
|
|
|
|
|
|
Create a named event. then any process can open that event and signal or detect it.
|
|
|
|
|
get the CEdit text, append what you to it, then refill you CEdit...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
What's wrong with toxcct's reply?
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
includeh10 wrote:
is it possible to append text to a normal CEdit?
Of course. The easiest way is to use SetWindowText() . But since you have a hangup with it, you'll need to use ReplaceSel() . To keep the insertion point at the "end" of the control, use SetSel() .
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hi,
I am using the below two line to execute an crystal report file from VC++. I can't able to see my report(Report is not displayed). i also specified the destination to window in the crystal control properties.
m_CrystalReport.SetWindowTitle("Trucks Loaded Report");
m_CrystalReport.PrintReport();
How can it invoked in other ways.. Urgent
Give me a touch... Regards,
Shanmuga Sundar.V
|
|
|
|
|
Hi,
Is there any API which gives the current downloading speed?
Thanks,
Vini
|
|
|
|
|
how to change background color of CRichEditCtrl?
includeh10
|
|
|
|
|
|
For other controls, the correct way would be with OnCtlColor() . However, I do not see a CTLCOLOR_xxx value for rich-edit controls.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
does CRichEditCtrl::SetBackgroundColor work ?
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
it is exactly what i want.
thx
includeh10
|
|
|
|
|
there are 3 std* handles: stdin,stdout,stderr;
we can use GetStdHandle() with STD_INPUT_HANDLE,STD_OUTPUT_HANDLE,STD_ERROR_HANDLE as param to get 3 handles also.
what are differences between the 2 group handles?
i.e. between stdin and GetStdHandle(STD_INPUT_HANDLE)?
in my dos program, GetStdHandle(*)s work well but stdin, stdout and stderr do not work. do u know why?
thx
includeh10
|
|
|
|
|
includeh10 wrote:
in my dos program, GetStdHandle(*)s work well but stdin, stdout and stderr do not work. do u know why?
Which indicates that you are possibly using them incorrectly. Please post the code snippet that is not working.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hi,
this dos app is an interface between other 2 apps, it is very short, here is all code:
1.if relacing GetStdHandle() with std*, the program is not working.
2. it works on win98, but doesn't work on XP, what is wrong?
//=============================================
int WINAPI Thread_Read(void*pv);
int WINAPI Thread_OutWrite(void*pv);
int WINAPI Thread_ErrWrite(void*pv);
struct BaseHandles
{
HANDLE hInWrite,hOutRead,hErrRead;
};
BOOL CreateProcessMe(char*pszCmdLine,PROCESS_INFORMATION&pi,STARTUPINFO&si)
{
void*psd=0;
LPSECURITY_ATTRIBUTES psa=0;
DWORD bNT=(GetVersion()>=0x80000000)?0:1;
if(bNT)
{
psd=::GlobalAlloc(GPTR,SECURITY_DESCRIPTOR_MIN_LENGTH);
::InitializeSecurityDescriptor(psd,SECURITY_DESCRIPTOR_REVISION);
::SetSecurityDescriptorDacl(psd,-1,0,0);
psa=(LPSECURITY_ATTRIBUTES)::GlobalAlloc(GPTR,sizeof(SECURITY_ATTRIBUTES));
psa->nLength=sizeof(SECURITY_ATTRIBUTES);
psa->lpSecurityDescriptor=psd;
psa->bInheritHandle=1;
}
const BOOL bOK=CreateProcess(0,pszCmdLine,psa,0,1,0,0,0,&si,&pi);
if(psa) ::GlobalFree(psa);
if(psd) ::GlobalFree(psd);
::CloseHandle(pi.hThread);
return bOK;
}
BOOL CreateDupPipe(HANDLE&hRead,HANDLE&hWrite,const BOOL bWrite)
{
SECURITY_ATTRIBUTES saPipe;
saPipe.nLength=sizeof( SECURITY_ATTRIBUTES );
saPipe.lpSecurityDescriptor=0;
saPipe.bInheritHandle=1;
HANDLE hTemp;
BOOL b;
HANDLE hProcess=::GetCurrentProcess();
if(bWrite)
{
b=::CreatePipe(&hRead,&hTemp,&saPipe,0);
::DuplicateHandle(hProcess,hTemp,hProcess,&hWrite,0,0,DUPLICATE_SAME_ACCESS);
}
else
{
b=::CreatePipe(&hTemp,&hWrite,&saPipe,0);
::DuplicateHandle(hProcess,hTemp,hProcess,&hRead,0,0,DUPLICATE_SAME_ACCESS);
}
::CloseHandle(hTemp);
return b;
}
int main(int argc,char* argv[])
{
PROCESS_INFORMATION pi;
STARTUPINFO si;
char szCmd[256];
int i,iLen=0;
if(argc<2) return 1;
szCmd[0]=0;
for(i=1;i<argc;i++)
="" {
="" strcat(szcmd,argv[i]);
="" strcat(szcmd,"="" ");
="" }
="" ------------------------------------------
="" memset(&pi,0,sizeof(pi));
="" memset(&si,0,sizeof(si));
="" si.cb="sizeof(si);
" si.dwflags="STARTF_USESTDHANDLES;
" basehandles="" bh;
="" dword="" dwid;
="" handle="" hthread;
="" createduppipe(si.hstdinput,bh.hinwrite,1);
="" hthread="::CreateThread((LPSECURITY_ATTRIBUTES)0,0,
" (lpthread_start_routine)thread_read,
="" &bh,0,&dwid);
="" createduppipe(bh.houtread,si.hstdoutput,0);
="" (lpthread_start_routine)thread_outwrite,
="" &bh,0,&dwid);
="" createduppipe(bh.herrread,si.hstderror,0);
="" (lpthread_start_routine)thread_errwrite,
="" const="" bool="" bok="CreateProcessMe(szCmd,pi,si);
" if(bok="=0)" return="" 1;
="" waitforsingleobject(pi.hprocess,infinite);
="" closehandle(pi.hprocess);
="" closehandle(pi.hthread);
="" 0;
}=""
int="" winapi="" thread_read(void*pv)
{
="" basehandles*pbh="(BaseHandles*)pv;
" hread="GetStdHandle(STD_INPUT_HANDLE);
" b;
="" dw;
="" char="" sz[1024];
="" while(1)
="" b="::ReadFile(hRead,sz,1023,&dw,0);
" if(b="=0)" break;
="" if(dw<="0)" sz[dw]="0;
" ::writefile(pbh-="">hInWrite,sz,dw,&dw,0);
}
return 1;
}
int WINAPI Thread_OutWrite(void*pv)
{
const BaseHandles*pBh=(BaseHandles*)pv;
const HANDLE hOutWrite=GetStdHandle(STD_OUTPUT_HANDLE);
BOOL b;
DWORD dw;
char sz[1024];
while(1)
{
b=::ReadFile(pBh->hOutRead,sz,1023,&dw,0);
if(b==0) break;
if(dw<=0) break;
sz[dw]=0;
::WriteFile(hOutWrite,sz,dw,&dw,0);
}
return 1;
}
int WINAPI Thread_ErrWrite(void*pv)
{
const BaseHandles*pBh=(BaseHandles*)pv;
const HANDLE hErrWrite=GetStdHandle(STD_ERROR_HANDLE);
BOOL b;
DWORD dw;
char sz[1024];
while(1)
{
b=::ReadFile(pBh->hErrRead,sz,1023,&dw,0);
if(b==0) break;
if(dw<=0) break;
sz[dw]=0;
::WriteFile(hErrWrite,sz,dw,&dw,0);
}
return 1;
}
includeh10
|
|
|
|
|
This is one of those situations where stdin /stdout and a HANDLE type cannot be interchanged. Remember that stdin /stdout are derived from the _iobuf structure, and the handles returned from GetStdHandle() are true handles (void* types).
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hi there
I am working on a application that is supposed to create a dial up connection in order to connect two computers using the serial port (direct connection using the serial port). I can create the entry no problem but the problem i am running into is that it will not attach the serial port to it (by the way i am using RAS API)
I am setting the device type to serial but the com port is not attached to the connection created.
If i try to create the same connection using the wizard that is provided with Win XP than it gives me the option to select the serial port as a means of communication. Once i create this connection and i run my program i get the desired output so it looks like the COM ports need to be configured for RAS. Is there any way to do that programatically or run a script?
Any help will be greately appreciated!!!
<br />
<br />
<br />
LPRASENTRY lpRasEntry = NULL;<br />
DWORD cb = sizeof(RASENTRY);<br />
DWORD dwRet;<br />
DWORD dwBufferSize = 0;<br />
<br />
<br />
<br />
RasGetEntryProperties(NULL, "", NULL, &dwBufferSize, NULL, NULL);<br />
if(dwBufferSize == 0)<br />
return FALSE;<br />
<br />
lpRasEntry = (LPRASENTRY)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwBufferSize);<br />
if (lpRasEntry == NULL)<br />
return FALSE;<br />
<br />
lpRasEntry->dwSize = dwBufferSize;<br />
lpRasEntry->dwfOptions = RasEntry.dwfOptions; <br />
lpRasEntry->dwfNetProtocols = RASNP_Ip;<br />
lpRasEntry->dwFramingProtocol = RASFP_Ppp;<br />
lpRasEntry->dwType = RASET_Direct;<br />
strcpy(lpRasEntry->szDeviceType, RASDT_Serial); <br />
<br />
<br />
strcpy(lpRasEntry->szDeviceName, ports[0].name);<br />
dwRet = RasSetEntryProperties(NULL, strEntryName,lpRasEntry, dwBufferSize, NULL, 0);<br />
<br />
HeapFree(GetProcessHeap(), 0, (LPVOID)lpRasEntry);<br />
|
|
|
|
|
Hi All,
I am using (Visual C++ 1.52 IDE )for my MFC Application Project. I am working on an existing code base where the no of lines is around 100,000, spread across different header and cpp files. when i was trying to add a new function declaration for an existing class in a header file and function implementation in the .cpp file i am getting an error as given below
: fatal error C1001: internal compiler error
(compiler file 'msc3.cpp', line 429)
CL returned error code 2.
in another .cpp file.
This problems also occurs when i try to add parameters to the existing function in an existing class
heap size is 1024 declared in .def file and i have set my stack size as 8500
Pls let me know if any one has solution to this problem
Thanks in advance
Regards
Senthil.
|
|
|
|
|
See if MSDN article Q149786 is of any help.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|