|
As far as I know this comes down to the implementation of the server exe. But, the ones generated using the AppWizard allow a switch to be passed to the exe to register it, such as
MyExe.exe /regsvr
Can't remember what the switch is that is used by the appwizard - you could try knocking up a sample app and looking in the code (I think it's in the main cpp file) where the switches are handled.
Hope this helps
|
|
|
|
|
shame on me...
In MDI project how open new document ?
i have a TreccCtrl and when i click on item and all window are closed i want to open new window ! like click on File->New.
|
|
|
|
|
CWinApp::OpenDocumentFile() should do the trick!
|
|
|
|
|
Martyn Pearson wrote:
CWinApp::OpenDocumentFile()
is not foe open an existing document ?
|
|
|
|
|
Try this:
AfxGetApp()->OnCmdMsg(ID_FILE_NEW, 0, NULL, NULL);
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
Yes thank you very much, that works perfectly.
|
|
|
|
|
Proper way is CDocTemplate::OpenDocumentFile(0).
You have to find appropriate DocTemplate , use GetFirstDocTemplatePosition/GetNextDocTemplate for it
|
|
|
|
|
thx you for your help but the Gary's solution work great and that is enough for me.
thx again !
|
|
|
|
|
Hello, I am using MSXML to get HTTP response from a webserver. The problem is when I use
pIXMLHTTPRequest.CreateInstance("Microsoft.XMLHTTP");
it always goes to error and can't continue to open the connection.
Can someone tell me where possibly the problem is, and why should I create the instance?
Many thanks in advance.
*****************************************
BOOL CAPIDlg::MakeRequest()
{
BOOL bRetVal=FALSE;
BSTR Result=NULL;
try{
MSXML::IXMLHttpRequestPtr pIXMLHTTPRequest;
HRESULT hResult;
hResult = pIXMLHTTPRequest.CreateInstance("Microsoft.XMLHTTP");
//Test the connection
if ( FAILED(hResult) ) {
MessageBox("Fail to create the connection");
return bRetVal;
}
MessageBox("Continue anyway");
//Open the connection
pIXMLHTTPRequest->open("POST",(_bstr_t)"www.yahoo.com");
//Send the request
pIXMLHTTPRequest->send();
MessageBox("Success to open");
//Get the result
Result=pIXMLHTTPRequest->responseText;
if(Result)
//Display the result
{m_Result.SetWindowText((_bstr_t)Result);
}
else
//Report error
MessageBox("Can't make the connection");
}
catch(...) {
//Report error
MessageBox("Can't initialize the HTTP request");
}
return true;
}
|
|
|
|
|
In some headers I see macros like following
<code>
#ifdef __cplusplus
#define EXPORT extern "C" __declspec (dllexport)
#else
#define EXPORT __declspec (dllexport)
#endif
</code>
What is this mean? and where could I learn much about these things?
karanba
|
|
|
|
|
karanba wrote:
What is this mean?
If _cplusplus is defined, anything that uses the EXPORT macro will not be exported with C++ name-mangling, and therefore your library can be consumed by app's written in any language, otherwise your consuming application's compliler must be able to work with C++ name-mangling.
karanba wrote:
where could I learn much about these things?
MSDN: http://msdn.microsoft.com[^]
Dylan Boycott Bush Punch GWB
|
|
|
|
|
This should be present on DLL source code. It defines a macro (EXPORT) that will be used in exporting functions. The first line tests for a C++ compilation. extern "C" means the function name will not be "mangled", or specially coded to allow for C++ function overloading. __declspec (dllexport) is used to export a function from a DLL.
Check MSDN for more info.
|
|
|
|
|
Hey guys,
Does somebody know how to create a simple user on a Win 2000 with the help of VC++ ?? Or are their any tools which i can use ? I know the tools "net" and "Addusers" but both does not provide the function to modify an existing user. I can easily create and delete users or even groups with the mentioned tool. But i also need to modify the Users or Groups. Please let me know if you have any solution.
Thanks
da sonu
|
|
|
|
|
I inserted a CTreeCtrl in a CDialogBar and have the problem that only the root element is displayed. When I click on it, it crashes. What might cause that? It works fine to just add children in a flat hierarchy with
myTree->InsertItem("hello1");
myTree->InsertItem("hello2");
myTree->InsertItem("hello3");
if I write:
hItem=myTree->InsertItem("hello1");
myTree->InsertItem("hello1 child", hItem );
it only displays hello1 and if I click on it, the application crashes.
any ideas?
thanks!
|
|
|
|
|
How is hItem declared? Make sure it is an HTREEITEM , otherwise you may be using the wrong overloaded InsertItem method!
|
|
|
|
|
|
Anonymous wrote:
so?
Bad news... The error must come from somewhere else.
|
|
|
|
|
And if you try to specified TVI_ROOT and TVI_LAST ?
HTREEITEM hItem = myTree.InsertItem("HELLO",0,0,TVI_ROOT,TVI_LAST);<br />
HTREEITEM hItemChild = myTree.InsertItem("HELLO 1",0,0,hItem,TVI_LAST);
|
|
|
|
|
Thanks, but it is still not working. The filling of the tree is okay. The data is in the tree. The problem is that is crashed when I click on the root item or if I say expand.
I did it without the wizard - so what do i have to take into account? are there any messages i have to process for clicking on an item?
|
|
|
|
|
Run the Debug Build from VC++ and do stack backtrace when the crash happens, and then out work why. Debuggers are very usefull tools.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
hi all,
I want to display some text in the reverse order ,like If the string is
"Read
Some text
today!"
it should come as
"daeR
txet emos
!yadot"
around some reference line
Is there any opengl funtion to do the same, or how should I do it?
ajit
|
|
|
|
|
render texture mapped text (as you usual do, e.g see www.gametutorials.com) and flip transformation matrix?
|
|
|
|
|
How can I set the text in a static control programmatically?
How can I make it appear even in de middle of hard processing? (I want to do this as information to the user about what process is being done?
Thanks,
F
|
|
|
|
|
Using MFC? Then use SetWindowText . If the static control does not update automatically, then immediately issue a InvalidateRect(NULL) followed by a UpdateWindow .
Have fun!
|
|
|
|
|
Superb!
Thanks a lot! That's exactly what I needed!
F
|
|
|
|