|
many spiders in the web ,
if u put open your email get ready for spam .
(not a restriction/requirement of this forum )
Vikas Amin
UNITED STATES STEEL CORPORATION
My First Article on CP" Virtual Serial Port "[^]
modified on Thursday, July 24, 2008 5:33 PM
|
|
|
|
|
Is it possible to set the debug info option through batch build script.
Note: I am not looking for the option through Visual Studio IDE
|
|
|
|
|
|
Thank you Mark. The links are very useful.
|
|
|
|
|
Hi there,
I want to create a button at run-time.
I have a dialog, derived from CDialog, of course.
I can add a CButton data member to my dialog class, for exmaple:
CMyDlg : CDialog
{
CButton btn;
}
and then
CMyDlg::OnInitDialog()
{
btn.Create (.....);
}
this will work.
My question is why can't I declare my CButton inside OnInitDialog (with no pointers) and have it work.
like:
CMyDlg::OnInitDialog()
{
CButton btn;
btn.Create (.....);
}
why? what is the difference? as a data member, CButton is not constructed either, so why is that?
Thanks a lot!
|
|
|
|
|
itaymaor wrote: why? what is the difference? as a data member, CButton is not constructed either, so why is that?
This is because, when the OnInitDialog() function returns, the destructor of the CButton will be called. And in the destructor, there is code to destroy the window.
|
|
|
|
|
Why you dont want to delcare it global?
|
|
|
|
|
itaymaor wrote: I can add a CButton data member to my dialog class
And that would be the appropriate place to do so
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I am using waitableTimmer to keep the UI active, during a very length call. Progress bar is working fine, but UI is Frised pls suggest me some good idea for this,
<pre>
HANDLE timer = CreateWaitableTimer(0,false,0);
LARGE_INTEGER li;
const int unitsPerSecond=10*1000*1000;
li.QuadPart=-(2*unitsPerSecond);
SetWaitableTimer(timer,&li,350,0,0,false);
_beginthreadex(0,0,TF,(void*) timer,0,0);
unsigned __stdcall TF(void* arg)
{
HANDLE timer=(HANDLE) arg;
while (1)
{
if(iStoped==0)
return 0;
WaitForSingleObject(timer,INFINITE);
prgBar->StepIt();
DoEvents();
}
_endthread();
return 0;
}
void DoEvents()
{
MSG oMSG;
while(::PeekMessage(&oMSG, NULL, 0, 0, PM_NOREMOVE))
{
::TranslateMessage(&oMSG);
::DispatchMessage(&oMSG);
}
}</pre>
|
|
|
|
|
You're running the message pump in another thread and not the UI thread. Message pumps are thread specific so it's not surprising that your code doesn't work.
Steve
|
|
|
|
|
how to create a translucent rectangle?
thanks.
regards,
tctan
|
|
|
|
|
|
You could use GDI+ and draw using an ARGB color. Adjust
the alpha value to the amount of "translucency" you want.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I need help on Rich edit control. I have placed it in the dialog box and I called the function AfxInitRichEdit() in InitInstance.
I have opened the properties of RichEdit and Checked the Button “Numbers” so that it can accept numbers only. But still it accepts characters ? Why ?
Can anyone help me on this ?
Thanks in advance!!!!
Thanks a lot
|
|
|
|
|
Hello friends,
I've an application that calls the webservice to upload file on server.
I've used MSSOAP toolkit 3.0, everything works fine for Windows XP.
The same code fails under Vista the code is as below.
ISoapConnectorPtr Connector;
hr = Connector.CreateInstance(__uuidof(HttpConnector));
if(hr != S_OK)
{
strErrMessage="Can't create Http Connector.
}
Connector->Property["EndPointURL"] = QPTLOGIN_URL;
hr = Connector->Connect();
In the code above hr = Connector.CreateInstance(__uuidof(HttpConnector)); fails on Vista and working fine in XP.
Can anybody please help me to solve this problem for Vista or any suggestions for calling webwservice in Vista OS.
Thanx in Advance.
ritz1234
|
|
|
|
|
How to work this out?
#ifdef SOME_DEF
#include "stdafx.h"
#endif <------------------------unexpected endif??
chesnokov
|
|
|
|
|
you're not supposed to include stdafx.h conditionnally...
this header which you'll find in any MFC program must be included before any other includes in every compilation unit.
I believe you'll have to disable precompiled headers to have a better try, but even that, I'm not sure it will work.
why are you trying to do that ?
|
|
|
|
|
I want the cpp file to be VS independent. There are no stdafx.h in Builder C++, and the rest. Only in VS. So you need to either use stdafx.h in every cpp or not to use it
chesnokov
|
|
|
|
|
actually, stdafx.h is not mandatory if your application is not linked to MFC.
also, as I already stated, try to disable Precompiled Header.
|
|
|
|
|
it is linked to MFC, the GUI, but the pure C++ lib is not, so you have to put to OS independent lib cpps that stdafx.h
chesnokov
|
|
|
|
|
then, why don't you just gneerate your lib in a non MFC linked DLL ?
that way, your GUI (which is using MFC) will still use stdafx.h like it was, and in your lib sources, you can remove every reference to that file...
|
|
|
|
|
Actually, stdafx.h is not required anywhere, even in MFC apps.
The only required header files are the ones your code may need
to compile.
You are free to use or not use pre-compiled headers, and you can
name the associated pre-compiled header file anything you want to.
As mentioned, you need to turn off the use of precompiled headers
or you can change the name in the settings or the name of the file.
stdafx.h has been the default precompiled header file for so long
that many think it's required
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
HI all,
I have assembly generated code of an simple program
C++ code:
int main(int argc, char* argv[])
{
int i =10;
int j =20;
int k = i+j;
return 0;
}
some assembly code generated of out it is:
PUBLIC _main
; COMDAT _main
_TEXT SEGMENT
_i$ = -4
_j$ = -8
_k$ = -12
_main PROC NEAR ; COMDAT
; 8 : {
push ebp
mov ebp, esp
sub esp, 76 ; 0000004cH
push ebx
push esi
push edi
lea edi, DWORD PTR [ebp-76]
mov ecx, 19 ; 00000013H
mov eax, -858993460 ; ccccccccH
rep stosd
; 9 : int i =10;
mov DWORD PTR _i$[ebp], 10 ; 0000000aH
; 10 : int j =20;
mov DWORD PTR _j$[ebp], 20 ; 00000014H
; 11 : int k = i+j;
mov eax, DWORD PTR _i$[ebp]
add eax, DWORD PTR _j$[ebp]
mov DWORD PTR _k$[ebp], eax
; 12 :
; 13 : return 0;
xor eax, eax
; 14 : }
My question is:
What is DWORD PTR syntax is
in following line
lea edi, DWORD PTR [ebp-76]
modified on Friday, August 8, 2008 5:46 AM
|
|
|
|
|
Does this link[^]
Help??
Regards,
Sandip.
|
|
|
|
|
Vikrams,
you've been asking here for long now.
when will you format your questions and make use of the <pre></pre> tags correctly ?
|
|
|
|