|
|
Comments and Discussions
|
|
 |

|
Hi.
I wrote own atl "Server as a service" but it's not working properly.
1) I run my service manually - OK
2) Then start's dcom client and in CoCreateInstanceEx place server runs again. And i see my task manager there are two myserver.exe apps are running! why?
VS2008
|
|
|
|

|
Sorry I don't know anything about VS2008 am just starting to work with it...will get back to you
I do know things are vastly easier if you use the Windows Communication Foundation instead of DCOM
Brian
Sincerely Yours,
Brian Hart
|
|
|
|

|
The tutorial is a bit old. I have noticed the author wrote a new one using .net to implement the same stuff but unfinished. Could you have you tutorials up-to-date.
|
|
|
|

|
At the following line in HelloServ.cpp
OBJECT_ENTRY(CLSID_HelloWorld, CHelloWorld)
I get the following compilation errors:
--------------------Configuration: HelloServ - Win32 Release MinDependency--------------------
Compiling...
HelloServ.cpp
C:\Program\Microsoft Visual Studio\MyProjects\HelloServ\HelloServ.cpp(21) : error C2653: 'CHelloWorld' : is not a class or namespace name
C:\Program\Microsoft Visual Studio\MyProjects\HelloServ\HelloServ.cpp(21) : error C2065: 'UpdateRegistry' : undeclared identifier
C:\Program\Microsoft Visual Studio\MyProjects\HelloServ\HelloServ.cpp(21) : error C2440: 'initializing' : cannot convert from 'int' to 'long (__stdcall *)(int)'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
C:\Program\Microsoft Visual Studio\MyProjects\HelloServ\HelloServ.cpp(21) : error C2653: 'CHelloWorld' : is not a class or namespace name
C:\Program\Microsoft Visual Studio\MyProjects\HelloServ\HelloServ.cpp(21) : error C2065: 'CreateInstance' : undeclared identifier
C:\Program\Microsoft Visual Studio\MyProjects\HelloServ\HelloServ.cpp(21) : error C2440: 'initializing' : cannot convert from 'int' to 'long (__stdcall *)(int)'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
C:\Program\Microsoft Visual Studio\MyProjects\HelloServ\HelloServ.cpp(21) : error C2653: 'CHelloWorld' : is not a class or namespace name
C:\Program\Microsoft Visual Studio\MyProjects\HelloServ\HelloServ.cpp(21) : error C2440: 'initializing' : cannot convert from 'int' to 'long (__stdcall *)(int)'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
C:\Program\Microsoft Visual Studio\MyProjects\HelloServ\HelloServ.cpp(21) : error C2653: 'CHelloWorld' : is not a class or namespace name
C:\Program\Microsoft Visual Studio\MyProjects\HelloServ\HelloServ.cpp(21) : error C2065: 'GetObjectDescription' : undeclared identifier
C:\Program\Microsoft Visual Studio\MyProjects\HelloServ\HelloServ.cpp(21) : error C2440: 'initializing' : cannot convert from 'int' to 'long (__stdcall *)(void *,const struct _GUID &,void ** )'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
C:\Program\Microsoft Visual Studio\MyProjects\HelloServ\HelloServ.cpp(21) : error C2653: 'CHelloWorld' : is not a class or namespace name
C:\Program\Microsoft Visual Studio\MyProjects\HelloServ\HelloServ.cpp(21) : error C2065: 'GetCategoryMap' : undeclared identifier
C:\Program\Microsoft Visual Studio\MyProjects\HelloServ\HelloServ.cpp(21) : error C2440: 'initializing' : cannot convert from 'int' to 'long (__stdcall *)(void *,const struct _GUID &,void ** )'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
C:\Program\Microsoft Visual Studio\MyProjects\HelloServ\HelloServ.cpp(21) : error C2653: 'CHelloWorld' : is not a class or namespace name
C:\Program\Microsoft Visual Studio\MyProjects\HelloServ\HelloServ.cpp(21) : error C2065: 'ObjectMain' : undeclared identifier
C:\Program\Microsoft Visual Studio\MyProjects\HelloServ\HelloServ.cpp(21) : error C2440: 'initializing' : cannot convert from 'int' to 'long (__stdcall *)(void *,const struct _GUID &,void ** )'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.
HelloServ.exe - 17 error(s), 0 warning(s)
|
|
|
|

|
My apologies, but I am unable to produce the errors myself...perhaps might you try using more up-to-date code (with some fixes) at
http://www.codeproject.com/com/HelloTutorialQA/HelloTutorial6_src.zip[^]
Just erase all of what you've downloaded and use the above. My apologies for not posting the fixes with this article...I have remedied this.
Sincerely Yours,
Brian Hart
Department of Physics and Astronomy
University of California, Irvine
|
|
|
|

|
Hi,
I haven't downloaded the code but have instead tried to do all the steps by myself (I think I'll learn better that way). So I guess I have done something wrong but I don't know why.
Thanks
Joachim
|
|
|
|

|
JockeP wrote:
I haven't downloaded the code but have instead tried to do all the steps by myself (I think I'll learn better that way). So I guess I have done something wrong but I don't know why.
Indeed, my apologies, but that is why I offer the code downloads. Download my sample code so you can compare what you have with mine.
Brian Hart
Sincerely Yours,
Brian Hart
Department of Physics and Astronomy
University of California, Irvine
|
|
|
|

|
If you're using this tutorial on Windows XP Pro SP2 and getting "Access denied" errors, then try this tip, From: sergeyv2002 (also at http://www.codeproject.com/com/hellotutorial7.asp?msg=1065427#xx1065427xx[^])
Hello Guys. Times are changing and so is Windows. So I wanted to notify everyone who is using this amazing tutorial: If you are running Windows XP Service Pack 2 and the final DCOM project doesn't seem to be working it means only one thing: You have to configure your DCOM.
Follow the link below to understand how:
http://www.canarylabs.com/Canary%20Labs%20XP%20Sp2.pdf[^]
additional keywords: DCOM Access Denied , E_ACCESSDENIED
Sincerely Yours,
Brian Hart
Department of Physics and Astronomy
University of California, Irvine
|
|
|
|

|
I wanted to ask you a question. I have a VB ActiveX exe that is registered as a DCOM server . I want to make the necessary entries on the client machine in order to allow the client to acces the server. The problem is that, the client is a part of another application and can be installed on the same machine as the server. If the client gets uninstalled, the CLSID for the server is removed. Is there another way of registering the enteries on the client side without shipping the Server binary.
Really need help with this
Anees Ghosh
|
|
|
|

|
Anees Ghosh wrote:
If the client gets uninstalled, the CLSID for the server is removed. Is there another way of registering the enteries on the client side without shipping the Server binary.
There should be a file in your server's project file with a .rgs extension, that is a Registry script which enters the keys. The server binary merely calls code to insert keys from this file. Although I don't know if .rgs files are used in VB. Otherwise, you may just have to ship the server binary -- in fact, having another copy of the server binary local to the client is mandatory (don't ask me why) if you are using Connection Points. But don't worry, if you call CoCreateInstanceEx() correctly, you will still activate the server on whatever remote machine you want.
-Brian Hart
|
|
|
|

|
Hi,
If we dont want connection points, Isn't there any method to just distribute proxy/stub dll which will also enter registry entry for ProgID and CLSID of Server without distributing actual binary of Server?
Thanks in anticipation !
|
|
|
|
|

|
Dear Readers: Thank you so much for reading my DCOM tutorial. Can you believe I wrote it in August 2000 and I still get messages and questions? Gosh, now that's staying power And keep those questions coming!
The Code Downloads Are Not Meant to Be Compiled As Is! They Are There So You Can See What I am Doing ONLY
I do very much enjoy answering your questions, and I am here to help. If I may ask a small favor though. It seems that the usual practice for people is to skip straight to Step 6 of the tutorial, and then download the code, and then skip to Step 7, and then download the code. Then you try to compile it and, lo and behold, Question Time!
If the Downloaded Code Works, Great! If Not, Try This Before Asking A Question:
May I please make a suggestion, and that is, if you do the above and have problems, perhaps it might be better to simply go to Step 1 [^] and simply follow along with me in Visual C++ as you go from Step to Step.
This is also because there are slight differences between Visual C++ Service Pack versions and the one I used to write this stuff. If you follow along, you're sure to generate code with the Wizards etc. that is compatible with your setup. Remember to do ALL the steps, in order, 1 through 7. Thank you!
Sincerely Yours,
Brian Hart
Department of Physics and Astronomy
University of California, Irvine
|
|
|
|

|
My OS is Windows 2000. I am unable to build because of the following errors on the code line Fire_OnSayHello(T2OLE(szComputerName)); in CHelloWorld::SayHello() method. The errors are:
- HelloWorld.cpp(20) : error C2065: '_lpa' : undeclared identifier
- HelloWorld.cpp(20) : error C2065: '_convert' : undeclared identifier
Generating Code...
I then tried to comment out this line, got an error of:
- Error executing c:\windows\system32\command.com
Is there anything missing in my NT driver?
Thank you for your help.
Thuy
|
|
|
|

|
Nguyenphuc wrote:
My OS is Windows 2000. I am unable to build because of the following errors on the code line Fire_OnSayHello(T2OLE(szComputerName)); in CHelloWorld::SayHello() method. The errors are:
Make sure your STDAFX.H file says:
#define _WIN32_WINNT 0x0500
Yours might be set to 0x0400, which is giving you the error.
Sincerely Yours,
Brian Hart
Department of Physics and Astronomy
University of California, Irvine
|
|
|
|

|
Thank you Brian,
I appreciate your tutorials. The instructions are very clear, and fun to read. You are right my _WIN32_WINNT was 0x0400. However, I still get one error as following:
Linking...
Building and registering proxy-stub...
Cannot find file 'nmake' (or one of its components). Check
to ensure the path and filename are correct and that all
required libraries are available.
Bad command or file name
Error executing c:\windows\system32\command.com.
Do you have any idea?
Thanks very much,
NP
|
|
|
|

|
Nguyenphuc wrote:
However, I still get one error as following:
Restart your computer, and press and hold down F8 once you see the "Microsoft Windows 2000" screen which comes on when Windows is loading. When the list of options appears, choose, "Command prompt only" to start windows at the "C:\>" prompt.
Next, go to the Visual C++ \bin directory, and run the program VCVARS32.BAT. Then press CTRL+ALT+DEL to restart the computer, and let Windows finish loading normally. Next try and see if things work.
Sincerely Yours,
Brian Hart
Department of Physics and Astronomy
University of California, Irvine
|
|
|
|

|
Thank you for your quick response. I still have the same linking error after running the VCVARS32.BAT in prompt command. There must be something incompatible between NT and 2000.
Regards,
Thuy
|
|
|
|

|
Thuy Nguyenphuc wrote:
Thank you for your quick response. I still have the same linking error after running the VCVARS32.BAT in prompt command. There must be something incompatible between NT and 2000.
The error you are receiving is not a linker error, but rather the system simply tries to run the path
nmake /f HelloServps.mk
1. Click the Project menu, and then click Settings at the bottom.
- This opens the Project Settings box.
2. In the Configurations drop-down, click 'All Configurations'.
3. Click the Custom Build Step tab -- you may have to use the scroll buttons on the right of the tabs to move the tabs over until the Custom Build Step tab appears.
4. Add the following line at the top:
call "C:\Program Files\Microsoft Visual C++\bin\vcvars32.bat"
before the "nmake ..." commands. Now try it.
Make sure to change C:\Program Files\Microsoft Visual C++\ etc to whatever your Visual C++ installation directory is.
Brian
Sincerely Yours,
Brian Hart
Department of Physics and Astronomy
University of California, Irvine
|
|
|
|

|
I've tried with setting for "All Configurations", added "C:\Program Files\Microsoft Visual Studio\VC98\bin\VCVARS32.BAT" only. It built the EXE file without error, but the DLL was not built.
If I also added "start /wait nmake -f HelloServps.mk", and "regsvr32 HelloServps.dll" after the line of VCVARS32.BAT then I would get the same error of:
Building and registering Proxy-Stub DLL...
Bad command or file name
Cannot find file 'nmake' (or one of its components). Check
to ensure the path and filename are correct and that all
required libraries are available.
Bad command or file name
Error executing c:\windows\system32\command.com.
What did I miss?
Regards,
Thuy
|
|
|
|

|
I am experiencing the same problems that nguyenphuc had at the beginning of this thread.
When trying to build the server I am getting 3 errors:
E:\DCOM_EX\HelloServ\HelloWorld.cpp(22) : error C2065: '_lpa' : undeclared identifier
E:\DCOM_EX\HelloServ\HelloWorld.cpp(22) : error C2440: '=' : cannot convert from 'char [16]' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
E:\DCOM_EX\HelloServ\HelloWorld.cpp(22) : error C2065: '_convert' : undeclared identifier
I tried adding as suggested by B.Hart:
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0500
#endif
and (later) also #define _WIN32_WINNT 0x0500 by itself to StdAfx.h but that doesnt help. Any other suggestions?
Thanks,
Neri Llosa
|
|
|
|

|
nerill wrote:
I am experiencing the same problems that nguyenphuc had at the beginning of this thread.
Make sure that the statement USES_CONVERSION; is in place everywhere in the code where the T2OLE macro is used.
Brian
Sincerely Yours,
Brian Hart
Department of Physics and Astronomy
University of California, Irvine
|
|
|
|

|
I am sorry, perhaps it must be an issue with your Visual C++ installation. Setup should set the necessary PATH, etc. variables for you to be able to run programs without needing to specify their paths explicitly.
Either: reinstall Visual C++; or change the command that starts nmake to:
start /wait "C:\Program Files\Microsoft Visual C++\Vc98\bin\nmake.exe" /f HelloServps.mk
see if that works. You may need to 'play' with the quotes a little in order to get the command to run. i.e. maybe the last " should go after the /f HelloServps.mk, but I forgot.
|
|
|
|

|
I am sorry, perhaps it must be an issue with your Visual C++ installation. Setup should set the necessary PATH, etc. variables for you to be able to run programs without needing to specify their paths explicitly.
Either: reinstall Visual C++; or change the command that starts nmake to:
start /wait "C:\Program Files\Microsoft Visual C++\Vc98\bin\nmake.exe" /f HelloServps.mk
see if that works. You may need to 'play' with the quotes a little in order to get the command to run. i.e. maybe the last " should go after the /f HelloServps.mk, but I forgot.
|
|
|
|

|
hi,
i have followed the steps, but HelloServps.dll is not builded and hence LoadLibrary() fails. This happens during build process in this step. I am using MS VC++ 6.0 with sp6 on XP machine.
10x in advance
|
|
|
|

|
The following error message appear:
C:\Program Files\Microsoft Visual Studio\MyProjects\HelloServ\HelloWorld.h(34) : error C2065: 'IID_DHelloWorldEvents' : undeclared identifier
I would be most graceful if one able to help me for this particular problem, thank you very much..
|
|
|
|

|
ho_min wrote:
The following error message appear:
C:\Program Files\Microsoft Visual Studio\MyProjects\HelloServ\HelloWorld.h(34) : error C2065: 'IID_DHelloWorldEvents' : undeclared identifier
Change all instances of 'IID_DHelloWorldEvents' in the project files to 'DIID_DHelloWorldEvents' to solve the problems. Notice that the new identifier begins with a 'D'.
Good luck!
Sincerely Yours,
Brian Hart
Department of Physics and Astronomy
University of California, Irvine
|
|
|
|

|
I got the same.
In HelloWorld.h, edit that line from
CONNECTION_POINT_ENTRY(IID_DHelloWorldEvents)
to
CONNECTION_POINT_ENTRY(DIID_DHelloWorldEvents)
Sorry, I cannot explain where the error is introduced, whether action from the VS Wizard or a typo we did or the writer of the tutorial.
|
|
|
|

|
Hi I've completed all the steps up to here successfully, the IDL complies etc... but when I build the project I get a message box informing me .....
LoadLibrary("HelloServps.dll") failed
GetLastError returns 0x0000007e
Any ideas ???
Cheers James
|
|
|
|

|
Anonymous wrote:
LoadLibrary("HelloServps.dll") failed
GetLastError returns 0x0000007e
The DLL file doesn't exist. Switch to the project directory, and on the command line, run
C:\...directory here...\> nmake /f HelloServps.mk
And this will build the Proxy-Stub DLL. Go back over Step 6 of the tutorial, and make sure that you have filled in the Project Settings dialog box correctly.
Sincerely Yours,
Brian Hart
Department of Physics and Astronomy
University of California, Irvine
|
|
|
|

|
I had the same problem. My exe builds correctly, but the DLL doesnt. I did indeed make the correct changes in step 6 too. Here is what happens if I do the nmake from the command line:
C:\Dokumente und Einstellungen\KurtH\Eigene Dateien\projects\HelloServ>nmake /f
HelloServps.mk
Microsoft (R) Program Maintenance-Dienstprogramm: Version 6.00.9782.0
Copyright (C) Microsoft Corp 1988-1998. Alle Rechte vorbehalten.
cl /c /Ox /DWIN32 /D_WIN32_WINNT=0x0400 /DREGISTER_PROXY_DLL HelloServ_
p.c
Optimierender Microsoft (R) 32-Bit C/C++-Compiler, Version 12.00.8804, fuer x86
Copyright (C) Microsoft Corp 1984-1998. Alle Rechte vorbehalten.
HelloServ_p.c
HelloServ_p.c(85) : fatal error C1189: #Fehler : You need a Windows 2000 or lat
er to run this stub because it uses these features:
NMAKE : fatal error U1077: 'cl' : Rueckgabe-Code '0x2'
Stop.
The funny thing is, I DO have windows 2000.
Man, microsoft really must have made some bad decisions. Ok, so they made all this COM stuff more complicated than it needs to be, thats ok, we can always use wizards. But what happens when the wizards are buggy?
In the linux world, they did things properly from the start. To implement something like this I simply use a library, no extra complications required which means no wizards either. And without wizards, its A LOT easier to go behind the scenes and fix it up yourself. I am really getting turned off of the microsoft approach with all its "you dont need to know how it works inside" mystery macros...
|
|
|
|

|
Heres some more info from HelloServ_p.c:
#if !(TARGET_IS_NT50_OR_LATER)
#error You need a Windows 2000 or later to run this stub because it uses these features:
#error /robust command line switch.
#error However, your C/C++ compilation flags indicate you intend to run this app on earlier systems.
#error This app will die there with the RPC_X_WRONG_STUB_VERSION error.
#endif
Nope its wrong. I never indicated, in my c or c++ compilation flags or elsewhere, that I intend to run this app on anything.
Oh and commenting out the above doesnt work either, windows is so sure that it belongs, that it re-adds it automatically!
|
|
|
|

|
What version of Windows are you compiling this on, and what version of VC++ do you have?
Sincerely Yours,
Brian Hart
Department of Physics and Astronomy
University of California, Irvine
|
|
|
|

|
I was attempting to compile it on Windows 2000 Professional with all latest sps and updates, and with visualc++ 6.0 sp6. I couldnt find any hack to get it to work either.
|
|
|
|

|
Kza Wah wrote:
I was attempting to compile it on Windows 2000 Professional with all latest sps and updates, and with visualc++ 6.0 sp6. I couldnt find any hack to get it to work either.
Perhaps you need to set-up the VC++ command-line environment variables which are needed to run the command line 'nmake' tools etc. Run VCVARS32.BAT.
First, use Search from the Start menu to figure out the path to the file. Then open up Command Prompt -- click Start->Run, then type 'cmd' and press ENTER. Then type the full path to VCVARS32.BAT, press ENTER. Follow the directions on the screen. Next, type the path to 'nmake' the dll (HelloServps.mk). Bear in mind 'nmake' should be run thusly:
C:\whatever\> nmake /f C:\Dir\HelloServps.mk
where you should put the full path to HelloServps.mk in there. It should work. Beyond this, I am stumped.
Perhaps you also might want to try following along with my tutorial, from Step 1, actually clicking on the Visual C++ buttons and filling fields as I say so instead of downloading the code. Perhaps the wizards do things slightly differently in SP6 of VC++ than in the version I was using (SP3)...
Sincerely Yours,
Brian Hart
Department of Physics and Astronomy
University of California, Irvine
|
|
|
|

|
Thanks a lot for the quick reply.
If I do run vcvars32.bat I do indeed get something different:
Microsoft (R) Program Maintenance-Dienstprogramm: Version 6.00.9782.0
Copyright (C) Microsoft Corp 1988-1998. Alle Rechte vorbehalten.
cl /c /Ox /DWIN32 /D_WIN32_WINNT=0x0400 /DREGISTER_PROXY_DLL HelloServ_
p.c
Optimierender Microsoft (R) 32-Bit C/C++-Compiler, Version 12.00.8804, fuer x86
Copyright (C) Microsoft Corp 1984-1998. Alle Rechte vorbehalten.
HelloServ_p.c
C:\PROGRA~1\MICROS~2\VC98\INCLUDE\rpcproxy.h(50) : fatal error C1189: #Fehler :
incorrect version. Use the header that matches with the MIDL compi
ler.
NMAKE : fatal error U1077: 'cl' : Rueckgabe-Code '0x2'
Stop.
So it seems to be some sort of version mismatch error. Probably some bug introduced with a recent Visual Studio service pack.
Incidentally I did go through all steps of the project by reading the instructions and using the wizards, I never used any downloaded code, but everything worked until this last step.
It would be nice to know what the problem is but the linux team has already won the race, not only completed the which-platform-evaluation but the whole project already!
|
|
|
|

|
Are you sure that you just didn't do:
> Build stuff with old VC++ (before updating the service pack)
> Update VC++
> Then try build again?
Sorry I can't help, but if you did the above that would be a problem. It's fixed by deleting the HelloServ_p.c and HelloServ_p.h and then try again. This will force the latest version of the compilers to generate all these files.
Sincerely Yours,
Brian Hart
Department of Physics and Astronomy
University of California, Irvine
|
|
|
|

|
I got the same error.
The trick is to make a couple of changes to your project
Firstly modify stdafx.h so that we compile for Windows 2000 i.e.
#define _WIN32_WINNT 0x0500
and similarly modify the proxy-stub make file HelloServps.mk as follows
cl /c /Ox /DWIN32 /D_WIN32_WINNT=0x0500 /DREGISTER_PROXY_DLL $<
Nice article by the way
Thanks.
Sean
-- modified at 15:57 Monday 24th October, 2005
|
|
|
|

|
I want add a method like this:
HResult getinfo([in]TCHAR flag,[in]long size,[out]BSTR * bstr,[out]TCHAR *cstr);
what should i do when i define the interface and dispinterface method;???
good lucky every body
|
|
|
|

|
Follow the same exact steps that I take when I add the IHelloWorld::SayHello method -- see Steps 4 and 5:
Step 4: http://www.codeproject.com/com/HelloTutorial4.asp[^]
Step 5: http://www.codeproject.com/com/HelloTutorial5.asp[^]
Notice how, in Step 4, we type 'SayHello();' into the lower box on the Add Method dialog. For your case, what you do is simply type 'getinfo([in]TCHAR flag,[in]long size,[out]BSTR * bstr,[out]TCHAR *cstr);'. Get it? What you type is the method's prototype, with all the [in] and [out] etc. Notice I don't include the quotes.
Sincerely Yours,
Brian Hart
Department of Physics and Astronomy
University of California, Irvine
|
|
|
|

|
Hi !
Seems to be a great tutorial. I have just skimmed it but will
walk through it thorughly when I get the time.
It's been a while since I was programming WIN32 on a regular basis and when I left off COM interfaces were the hot thing.
Now I want to make a remote access object for controlling a
DAQ card over the network.
I am just wondering whether DCOM is the thing to get into or if are there similar things in the .NET concept that are more state of the art from Microsoft. I must admit I haven't looked very deep into .NET som maybe my question is not so clever, but I want to put my effort in learning the latest technology.
Regards
Jan
Jan Andersson
Embedded systems engineer
|
|
|
|

|
DCOM is a legacy technology, but .NET (and managed code) will impose an overhead on your performance if you care about that for low-level systems and comm applications, since DCOM is written in C++, whereas .NET is 'managed' (garbage-collected etc.)
There are "religious wars" being fought over this (so to speak)...
But if your application is controlling a DAQ card, and doing data acquisition, then you'll want to give DCOM a try.
.NET is more suited for, say, airline reservations apps and apps you can run from your mobile phone than low-level systems apps which it sounds to me like you are running. And you get the nice fast performance of native, compiled code -- .NET is interpreted. Even when you write in "Managed C++."
|
|
|
|

|
Hi,
If I change the method in the tutorial to return some other string other instead of the computer name but with all other things remaining the same, what do I need to do to update this method?
Do I just register the two commands on the server side?
I keep getting this error "fatal error LNK1104: cannot open file "ReleaseMinDependency/HelloServ.exe" when I build the server application with the amended method.
Can someone please advise? Thank you!!
|
|
|
|

|
dapipi wrote:
If I change the method in the tutorial to return some other string other instead of the computer name but with all other things remaining the same, what do I need to do to update this method?
You have to change only the name of the parameter to what you want it to be; i.e.
BSTR bstrComputerName -> BSTR bstrMyString
Do this in the HelloWorld.cpp file where the method is defined, do this in the HelloWorld.H file where it is declared, and do it in the HelloServ.idl file where it is also declared for use with COM.
Sincerely Yours,
Brian Hart
Department of Physics and Astronomy
University of California, Irvine
|
|
|
|

|
i copied HelloSev.exe,Helloservps.dll in c:\winnt\system32 and registed dll in server machine.if iam trying run client it is giving the following error?
Unable to access IHelloWorld because Class not registered
|
|
|
|
|

|
Hi! Does anyone know how I can put a version number to the dll before you register it? It would be great if I could get an answer to this. Thanks.
Ana Jiménez
|
|
|
|

|
Hi
I've been following the tutorial using VC++ 7.0 running on XP. As the ATL COM wizard doesn't exist with this version of VC++, I downloaded the step1 files and opened the project from there.
I've so far managed to follow the instructions successfully but I have the problem of the DLL not being compiled at the end of step6. I have tried building the dll from the cmd line using the makefile but it spits out a load of errors:
cl /c /Ox /DWIN32 /D_WIN32_WINNT=0x0400 /DREGISTER_PROXY_DLL HelloServ_p.c
HelloServ_p.c
HelloServ_p.c(85) : fatal error C1189: #error : You need a Windows 2000 or later to run this stub because it uses these features:
Is there something wrong with my project setup or is it something else?
Also, Does anyone know if there is an equivalent to the ATL COM wizard under .NET ?
Many thanks
Jim
|
|
|
|

|
I should have known this would happen, no sooner had I posted my problem than I discovered a solution. Just in case anyone else has the same problem, to save yourself banging your head against a brick wall for hours as I did, try the following: - In the Project directory, open up the makefile, 'HellServps.mk' in a text editor and change the definition, '/D_WIN32_WINNT=0x400' to '/D_WIN32_WINNT=0x500'. If you either rebuild the project or run the makefile from the command line, this should now work and create the dll. Jim
|
|
|
|

|
1. Open STDAFX.H
2. Find the line that says
#define _WIN32_WINNT 0x0400
3. Change the hex value from 0x0400 --> 0x0500
4. Open the makefile for the DLL, and do a Search->Replace and replace all instances of 0x0400 with 0x0500.
Sincerely Yours,
Brian Hart
Department of Physics and Astronomy
University of California, Irvine
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.
|
We build our new server and install it on the server machine.
| Type | Article |
| Licence | CPOL |
| First Posted | 6 Aug 2000 |
| Views | 484,937 |
| Downloads | 2,810 |
| Bookmarked | 63 times |
|
|