|
OldViking wrote:
It has the child-style set.
This is the problem I bet. If you are trying to show a modal dialog box, don't make it a Child, make it a Popup style. If your point was to embed the dialog on a different window, that's a whole different story.
So, for now, go change that Child style to Popup, and you don't need to create the dialog on the heap if it's a modal dialog. Just create it on the stack:
C_ICantRememberTheClassName_Dlg dlg;
dlg.DoModal();
Chris Richardson Terrain Software
|
|
|
|
|
I recommend you teach yourself via one of the many available tutorials on MSDN. I used Scribble and it helped tremendously with all this stuff.
Regards,
Alvaro
If you want to get to the top, prepare to kiss a lot of bottom. -- despair.com
|
|
|
|
|
Hi,
I want to change the Winlogon policy
programmatically. This I'm able to do by finding some of
the registry entries in the Windows registry which would
bring this policy into effect.
But changing this policy through registry don't show the
changed status in the windows 2k Local Security Policy
snap-in.
What shall I do to reflect this change in the Local
Security Policy Snap-in.
Thanks,
Abhishek.
Learning is a never ending process of Life.
|
|
|
|
|
Hello,
i have a text file where i store a number. When i read the value in my szBuffer(CString) i like to cast this to an integer because i want to increment this value.
After the incrementation i like to write the value back into the file. So cast from int to CString(szBuffer)
Any ideas, code?
Thanks, Mark
|
|
|
|
|
try this:
iInteger=atoi(LPCTSTR(csCString));
iInteger++;
csCString.Format("%d",iInteger);
this should do it!
greets,
Jason
|
|
|
|
|
yeah, works great. And how is the function to cast int to CString??;)
Thanks, Mark
|
|
|
|
|
C style:
char buf[10];
int number = 5;
sprintf(buf, "%d", number);
CString bleh = buf;
STL style:
#include <sstream>
std::ostringstream str;
int number = 5;
str << number;
CString bleh = str.str().c_str();
MFC style:
CString bleh;
int number = 5;
bleh.Format("%d", number);
Boost style (www.boost.org):
#include <boost/lexical_cast.hpp>
int number = 5;
std::string str = boost::lexical_cast<std::string>(number);
CString bleh = str.c_str();
|
|
|
|
|
Oh yes ok. I am still sleeping...
Thanks, Mark
|
|
|
|
|
As i already wrote: if you are using the MFC CString class, simply use
CString::Format();
else use
sprintf();
examples:
csCString.Format("%d",iInteger);
or
sprintf(cBuffer,"%d",iInteger); (where cBuffer is of type char*)
greets,
jason
|
|
|
|
|
everybody
i am getting problem in embedded display( i am using in place active verb for display) when ever i run program for the excel embedded display it self i am unable to resize it where as it is fine with the word or any other component with the same source code can any body help me?\
thanks in advance
naresh
|
|
|
|
|
hi
how to load a jpg/bmp image in an sdi application as the background graphics.... help help help me....
and yah how u can show ur own graphics instead of titlebar.... plz help and answer as soon as possible
happy programming u all
regards
Nauman Ghazi
Bahria University
|
|
|
|
|
The following example code can be used for loading a BMP file image in any vc++ application.
HBITMAP hbitmap;
hbitmap = (HBITMAP)LoadImage(NULL,"C:\\house.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);
HDC hmemdc;
hmemdc = CreateCompatibleDC(pDC->m_hdc);
SelectObject(hmemdc,hbitmap);
BitBlt(pDC->m_hdc,0,0,image_width,image_height,hmemdc,0,0,SRCCOPY);
For viewing as a background image in an SDI application the above code can be used inside the OnDraw(CDC *pDC) method of view class.
For loading a JPEG file you can use external JPEG libraries such as the
IJL15.DLL which is freely available.
R.Balachandran
|
|
|
|
|
hi all
i want to add a list control to an sdi application which couldnt be derived fron CListView in the start(while making the software through the wizard)how can i do it and furthermore i want to display icons with each item .... please reply as soon as possible ... and plz tell with explanation as i am a beginner ...
do tell me that where to place the code as well coz i am facing problems in this regard also
take cares and
happy programming
Nauman Ghazi
Bahria University
|
|
|
|
|
Hello All,
I have a bitmap having a set of pixel values arranged in the form of a sine curve. Keeping the starting point, end point and direction of the sine curve intact I want to remove the troughs and crests in the sine curve and make it a straight line.. How to go about it.
Thanks
Rajdeep
|
|
|
|
|
hi all,
I am writing a text file..I am using BHO and when i am trying to write the data in DISPID_NAVIGATECOMPLETE2...it shows an exception and IE is closed..I am opening the file in setsite and closing it in destructor..am i doing something wrong..please help..any pointers and ideas..please..
Himanshu
|
|
|
|
|
hi all,
I am using a BHO and i want to open a popup when IE fires event DISPID_NAVIGATECOMPLETE2...can anyone help me out..any pointers and ideas are welcome..Ur help will be highly appreciated..I am in urgent need..please..
Thanks in advance..
Himanshu
|
|
|
|
|
deaR ALL,
how do i compress or zip files using win32 api or mfc
also can i uncompress those files.
thanx
|
|
|
|
|
Have you tried searching the articles here at CP - I'm sure the effort will reward you. FYI there is no Win32 or MFC support for zip files.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
I want a format string convert to float, double. Is it possible?
I think it's possible, just look at the edit control DDX with a float data member(in fact, this is a string to float).
However, I dont know how to do this conversion.
Could u help me? Thanks in advance.
//----------------------
no silver bullet
//======================
|
|
|
|
|
|
|
thanks
I'll check the FAQ first, next time
//----------------------
no pains, no gains
//======================
|
|
|
|
|
:(Hello!,
I have a problem with static function, to access to member variable at same dialog class, both the static function and member variable are class members.
The problem begin when i try compile a program with a function in a AfxBeginThead instruction with errors. I solve that problem, using a static function, but now i can't access a data member variable, of the dialog class of my project.
Please help me!!!
Thank for your collaboration.
greating. mperlera
|
|
|
|
|
Since static functions do not have an implicit 'this' pointer, you cannot access any member (non-static) functions or data from within the static function. However, AfxBeginThread() allows to provide a user-defined parameter to your static thread function. In this case, you can pass in the pointer to the dialog as the user-defined parameter, and then use that within your thread function to get at the members.
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
What you usually do is something like the following:
UINT CMyClass::ThreadFunc(LPVOID p)
{
CMyClass* pMyClass = (CMyClass*)p;
p->SomeNonStaticFunc();
p->DataMember = 0;
...
return 0;
}
void CMyClass::SomeFunc()
{
AfxBeginThread(ThreadFunc, this);
}
--Dean
|
|
|
|