|
hi prasad,
BOOL mymainApp::InitInstance()
{
// InitCommonControls() is required on Windows XP if an application
// manifest specifies use of ComCtl32.dll version 6 or later to enable
// visual styles. Otherwise, any window creation will fail.
InitCommonControls();
CWinApp::InitInstance();
AfxEnableControlContainer();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need
// Change the registry key under which our settings are stored
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
mymainDlg dlg;
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
// dismissed with OK
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
}
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
}
here is for main dialog which is created
Thank you
venu
|
|
|
|
|
its look perfect to me,too. For just a try,
try creating mymainDlg object on heap, i.e.
code will look like this,
mymainDlg* dlg=new mymainDlg;
m_pMainWnd = dlg;
int nResponse = dlg->DoModal();
if (nResponse == IDOK)
{
}
else if (nResponse == IDCANCEL)
{
}
delete dlg;
|
|
|
|
|
Another thing you need to take note is that if you call more than 1 time, you will create memory leaks because you didn't check if there's any memory previously allocated to those pointer variables.
|
|
|
|
|
Hi all,
I made an Application in VC++ , as usual it includes StdAfx.h and StdAfx.cpp files .
What I need to do is to eliminate only "StdAfx.cpp" file from my Application.
How can in Achieve it.
Thanks in Advance.
George K Jolly
-- modified at 2:20 Wednesday 16th August, 2006
|
|
|
|
|
georgekjolly wrote: I made an Application in VC++ , as usual it includes StdAfx.h and StdAfx.cpp files .
What I need to do is to eliminate only "StdAfx.cpp" file from my Application.
The main purpose of StdAfx.cpp file is to get the contents of StdAfx.h file compiled, since .h file cannot be compiled. This is done for generating a pch ( PreCompiled Header ) file.
You can disable the use of precompiled files by going to Project Settings --> C/C++ --> PreCompiled Headers --> Not Using Precompiled headers.
As far as your question is considered you can delete StfAfx.cpp but this breaks the purpose of the file.
|
|
|
|
|
Hi Nibu,
ThankYou Very much for ur Answer
George K Jolly
|
|
|
|
|
Press "Enter" key and "ESC" key would dismiss a MFC modal dialog. These two key down events cannot not be directly captured and processed by the modal Dialog as the dialog will be immediately dismissed when user press the two keys.
Is there any way to avoid this happening? Is there any way to modify this behaviour of MFC model dialog?
|
|
|
|
|
|
Hi, Mike. Did you get my email ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
|
You need to override OnOK and OnCancel in your dialog
|
|
|
|
|
Hi all,
in my project i am having a docking window on with class CDocBuild
class CDocBuild:public CSizingDocBar
now i want to create a tab control in this docking window.
in which there will can be build result window,watch window etc
something like vc6.0 build window.
so currently i am adding CTabCtrl m_wndTabCtrl as a public member in this class.
and then doing InsertItem to create new tabs and associating imagelist with it.
but InsertItem returns 0 based index of the new tab. it doesnot give handle to the newly added tab. so that's why i am not able to create new child window in this page.
so i want to create child window's in this new pages such as edit box list view etc. so How should i proceed?
and one more question as i said i am adding public member as m_wndTabCtrl which is object of CTabCtrl but i am confused whether i should derive a class from CTabCtrl and then make it's object as m_wndTabCtrl??
class BuildTab: public CTabCtrl
{
};
BuildTab m_wndTabCtl;//in docking window
What advantage this method gives??
Thanks and regards
Harshal
|
|
|
|
|
Hi,
I had developed a client program which uses CAsyncSocket... I used to create the socket as m_mySocket.Create(0,SOCK_STREAM) where m_mysocket is an object of the class derived from CAsyncSocket.
When this program runs on "Microsoft Vista" operating system which uses IPV6 ...it is throwing an error "10047(An address incompatible with the requested protocol was used. )".
Can anyone tell me how to solve it?? I am very new to IPV6.
Thanks and Regards.
Pappu Kumar
|
|
|
|
|
I downloaded this sample project:
http://www.codeproject.com/dialog/wizard2000.asp
and added a menu bar with File/New, Open and Save. I also added CDoc, but
I cant get it to serialize any data, not even call the serialize functions.
Is it possible to serialize data using this design? If so, how would I
go about. A simple project that serializes just a little data would guide
me significantly.
I thought about creating an SDI application with many views that mimics
this Wizard look, but Im hoping I can adjust the Wizard.
Please, any response any one can give me will be greatly appreciated.
Sincerely,
Danielle Brina
|
|
|
|
|
Here is the code the get image and save as the computer!!!However, sometimes the image did not get all bytes. (e.g image size= 85,687 bytes but it only get 75,776 bytes) It is sometimes only.....I don't know what the problem is?
Can anyone help?
<br />
UINT nBytesRead;<br />
TCHAR szBuf[CHUNK_SIZE] = {0};<br />
CFile objThumbFile;<br />
CHttpFile* pHttpFile = <br />
pHttpConnection->OpenRequest<br />
(_T("GET"), <br />
_T(strPhotoLink), <br />
NULL, 1, NULL, NULL, <br />
INTERNET_FLAG_KEEP_CONNECTION |<br />
INTERNET_FLAG_EXISTING_CONNECT |<br />
INTERNET_FLAG_DONT_CACHE |<br />
INTERNET_FLAG_RELOAD);<br />
<br />
CString strResponse;<br />
if(!objThumbFile.Open(strOutputFileName, CFile::modeCreate | CFile::modeWrite, NULL))<br />
return false;<br />
do<br />
{<br />
nBytesRead = pHttpFile->Read((void*) szBuf, CHUNK_SIZE);<br />
strResponse += szBuf;<br />
objThumbFile.Write(szBuf, CHUNK_SIZE);<br />
i++;<br />
}while(nBytesRead > 0);<br />
<br />
objThumbFile.Close();
|
|
|
|
|
You can use also from URLDownloadToFile
|
|
|
|
|
mimimimilaw wrote: strResponse += szBuf;
If szBuf contains more than one \0 character, this obviously will not work.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
SOAP 1.1 fault: SOAP-ENV:Client [no-subcode]
"Multipart/Related type specified a root type other than the one that was found."
Detail: [no-detail]
|
|
|
|
|
could u be more specific? what code caused this issue? XMLHTTP?
Cheers Milton KB
|
|
|
|
|
I try to send a jpeg image to SOAP server using gSOAP from www.sourceforge.net, but it always reponses me the error message:
SOAP 1.1 fault: SOAP-ENV:Client [no-subcode]
"Multipart/Related type specified a root type other than the
one that was found."
Detail: [no-detail]
How to solve this problem?
the code is as following:
std::string message = "image/jpeg";
xsd__hexBinary image;
ns1__sendMimeImageJPEGResponse pr;
FILE* file = ::fopen("d:\\t-shirt.jpg", "rb");
char buff[655350] = {0};
int nSize = 0;
if (file != NULL)
{
char* pos = buff;
int size = 0;
while((size = ::fread(pos, sizeof(char), 25, file)) > 0)
{
pos += size;
nSize += size;
}
}
image.__ptr = NULL;
image.__size = 0;
soap->http_content = "text/xml;charset=utf-8";
soap_set_mime(soap, "MIME_boundary", "<mimepart=29922.29292@mydot.com>");
soap_set_mime_attachment(soap, buff, nSize, SOAP_MIME_BINARY, "image/jpeg", "<mimepart=29922.29292@mydot.com>", NULL, NULL);
int nRet = soap_call_ns1__sendMimeImageJPEG(soap, url, NULL, message, image, pr);
if (nRet == SOAP_OK)
printf("\nCurrent returned value %s\n", pr.result.begin());
else
soap_print_fault(soap, stderr);
-- modified at 22:03 Wednesday 16th August, 2006
|
|
|
|
|
Ok well i have been asking around for sometime now to find this out so far no help. Hopefully someone here can help. Im trying to learn how i could make it so my already compiled program makes an exe file. For example a the program asks a question. You give an answer and then you press enter to create an exe with the answer. I tried the <fstream> but that dosn't work because im trying to make an exe.
Another example would be a trojan. Some trojans give you options. You fill in the options you want and then click create and it creates a server for you. Im trying to find how to make the exe so please help some. I tried to explain best i could.
|
|
|
|
|
In order to create an exe, you need to ship a compiler with your program.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Ok sweet thx for the reply. Can you be a little more specific. Like how would i go about doing that. Would i have to make my own compiler(which i doubt i can) or what.
|
|
|
|
|
gcc is free, you could distribute that, and run it from your code, and collect the result. I guess.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Alright thx. Ill give it a try. Thx again you have given me actual answers compared to other people on other forums.
|
|
|
|