|
|
that was remarkably generous of you, considering the quality of the question !
(I doubt you'll get a thanks, I could be proven wrong)
'g'
|
|
|
|
|
We are developing a desktop application and the current mode we are using to display the content in the active desktop uses ActiveX controls, but this is not the best method to do this.
Some active desktop tools we saw are able to put the content inside a window and display it behind the icons. Also Bspalyer has a mode named desktop mode that can do this. We are trying to find out how this could be done.
Any help is highly appreciated.
|
|
|
|
|
Starting with the IE4 shell, you can add a web page as a desktop item. This page can have anything you want in it (subject to the usual IE security restrictions, of course). I don't know if Vista still supports this, I would guess so but I still can't find squat in Vista's control panel so I can't verify it.
|
|
|
|
|
1. I created a c# class.
2. Ran regasm file.dll /tlb
3. Ran gacutil -i file.dll
Now I'm trying to create an instance of this in VC++ or view it as an object in OLECOMViewer (comes with VS.NET) but I keep getting
"80070002 system cannot find specified file" error when trying to instantiate this object or view its com object in olecomview.
Can anyone help? I just need its funcionality in VC++.
thanks all!
L
|
|
|
|
|
Hi,
I wonder if we can start any console application which resides on a remote system from another system. Say I have abc.exe console application on pc2 and I would like to run it from pc1 say via an ethernet cable. There is no bi-directional data transfer, all I have to do is, whenever the user on pc1 wants to run that application he will communicate with pc2 to start the console application.
Yeh I know you can do that by having another program on pc2 running and listening to the ethernet port. But is there any other way to run the application on pc2 without having another program on pc2 listening to the ethernet port??
I am not sure if I am clear, but lemme know if I am not clear.
thanks,
-Pavan.
|
|
|
|
|
Just an idea, and probably not what you want to hear, but if I were going to do this, I would create a COM server, register it on PC2, and use it to start a separate console application on PC2. Then, I would set up my console application on PC1 to act as a COM client, remotely instantiating the COM server on PC2. When it creates the (remote) COM server, the creation process itself could indicate the the COM server is to launch the PCS console application.
With this framework, you could even set up the COM server on PC2 such that you could tell it which of serveral console applications you would like it to start.
Of course, this all presumes that you understand how to build COM servers and clients. This isn't too bad if your using C# or VB.net with VS 2005. Much harder if your using straight C++.
Scott

|
|
|
|
|
I am also thinking exaclty on the same lines. Have an application running on pc2 listening to the network all the time (client) and whenever it receives message from pc1 (server) it executes the corresponding routine/program. But since I am coding this in vc++, are there any readily available libraries/programs to setup this kind of client/server.
Actually I do have some files which I use in my other MFC applications (without any problems) where I do exactly the same, those files are like SCNet, SDLnet, SDLnetsys, SDLnetTCP, SDLnetUDP, SDLx. But I am not able to use these files in my vc++ program as when I try to compile the program after adding all those files to the project and including the header files in the program, it gives me 155 or so errors all of them are of undeclared idetifiers and all the errors are in those added files.
-Pavan
|
|
|
|
|
I have tried this creating a client/server architecture. I have created a server program on the PC on which I would like to run the programs and then used a client program on another PC to send messages to the server to start/stop a program. The problem is, from the time I disconnect and reconnect the client, the server doesn't recevie any messages from the client untill I reinitiate/rerun the server side program. I am using Ethernet to communicate. I am not having any COM ports left to use on client system, so the remaining are USB, parallel and ethernet ports.
Is there anyway to overcome this. I would like to run the server program all the time listening to the client requests no matter whether the client connects/disconnects. In other words, I would like to run the server program when windows boots and closes at windows shutdown and keeps listening to the client requests.
thanks,
-Pavan.
|
|
|
|
|
OK, you can do what you suggest but it is a little different than what I was thinking. I see two basic ways to do this, both of which are perfectly reasonable:
1 - Use a COM server and client, as we have already discussed.
2 - Use a SERVICE program running on the server, which is continually listening to a specific port for incoming connections using Windows sockets.
Your statement above indicates that you are thinking in terms of the second approach.
Let me clarify the first approach a little. A COM server typically only resides in memory when a client has requested its service, and therefore has a REFERENCE to the COM server. When the client closes down, it releases the reference to the COM server, and when the COM server realizes that there are no "open" references to it, it shuts itself down. This is typical behavior in the COM world. This is OK, because with the proper registry entries on both the server and client machines, the Windows COM system will automatically locate and launch the COM server when a client requests its services. It seemed to me that your client would simply invoke the server, getting a pointer to the server's interface, then invoking an interface function that would launch a specific program on the server.
Because the Windows COM system handles launching the COM server, you don't need to worry about whether the COM server is always on and always "listening" for incoming client requests. It will get started up as soon as a client requests one of its interfaces.
Now, for approach number two...I have done this type of thing as well, using a SERVICE program, which is NOT the same thing as a COM server. Not too long ago, I wrote a service program that I set up to start every time the operating system was started. These programs show up in the "Services" program under "Administrative Utilities" in the control panel. There are a number of articles that discuss how to write a service program. In my case, my service program was designed to "listen" on a user-selectable port for incoming socket connections. When a connection was established, it would spin off a thread to process bi-directional communications between the service program and the client. This was all done using the WinSock API. In this case, the service program was always running and listening for incoming connections.
I wish I could help you more, but it seems to me you will need to first decide which of the above approaches you wish to take (or yet another approach if someone else has made any additional suggestions).
Also, please note that I don't use MFC or ATL, nor have I dabbled too much yet with C# and .net. All of my code is straight C++ with direct calls to the Windows API. So, I will be unable to help you with code snippets if you're looking for MFC or C# stuff, etc.
I need to get back to work now. I'll check back this evening.
Scott
|
|
|
|
|
Thanks for explaining in detail. I think I would go with the second approach. I am not worried about the server side program as its a basic c++ console application (I can even end up executing exe files depending on the message it receives), but on the client side, I have to send messages from both MFC based application and also from basic c++ application DLL. But I can try both of the approaches that you suggested and see which one is more feasible within my application.
thanks,
-Pavan.
|
|
|
|
|
Google for Remote Procedure Calls (RPC).
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Good People,
Two quick questions:
1) Can I put texts and graphics in one CView?
2) Are there any tools to layout a CView graphically? For example, supposed I want a layout that is similar to the Code Project homepage. Is there a tool that can help me do that or do I have to write that myself.
Thanks,
BP
|
|
|
|
|
1 - of course, you can put anything you like
2 - only if you use a CFormView, in which case you get a dialog template you can lay out.
Christian Graus - C++ MVP
|
|
|
|
|
I'm beginner ,and I've got a exercise .I want to create a text box so we can input text in a rectangle.And the rectangle is created by moving mouse.
Thanks
|
|
|
|
|
You might want to start with capturing the mouse. When the user holds down the mouse button and drags, you can compare the POINT at WM_LBUTTONDOWN to the POINT at WM_LBUTTONUP. This will give you a rectangle. From there all you need do is create an EDIT control.
|
|
|
|
|
This is pretty advanced for a beginner. Do you know any MFC at all ? Are you using MFC ? Is this homework ? Are you sure you've got it right ?
I've done this, it's far from impossible, but I wouldn't assign it as a 'beginner' task.
Christian Graus - C++ MVP
|
|
|
|
|
I have an MFC exercise . In my application , i have 2 text box , user will fill there. after that , i must get data from 2 text box and write it to file ( Not important there are textfile or binaryfile ) . at the end, i must read data from this file (i have made) , fill it in to 2 another text box. Who can help me . I'm waitting for you reply. my email:rit116@yahoo.com
|
|
|
|
|
I'm not going to actually write code for this since it sounds much like a homework assignment. However, you might want to check out MSDN and also check out the CDocument save procedure.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Apart from beeing nonportable. Is there any benefit from using #pragma once over the standard include guards on a modern compiler like VS2005?
There used to e the argument that it is faster because the copmpiler does not have to reopen the include file multiple times. Is this still the case?
I would expect a state of the art compiler to automatically detect include guards which is the case in gcc but the sole existance of pragma once implies this it not the case with MSVC 8.x.
Am I right? What are your best practices?
|
|
|
|
|
|
Do the words "Implementation-Specific" or "platform dependant feature" mean anything to you? Please do yourself a favor and get a copy of the ISO 14882. Then find out why claiming any pragma directive has to be supported by any compliant compiler is complete nonsense. Any compliant compiler has to ignore pragma directives it does not know thats all.
|
|
|
|
|
No #pragma is "C++ compliant". The sole purpose of #pragma is to provide a hook for compiler specific control.
--
Now with chucklelin
|
|
|
|
|
MSDN
Presently, #pragma once is NOT portable, so if you are writing code that might be compiled on another system or for another compiler, it is best to stick with include guards.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
I know it's not supposed to be portable. But do you actually know any significant C++ compiler not implementing it? GCC has it and in fact they invented it, although it is commonly blamed on Microsoft, BCC has it, and MSVC has it. I would bet the Intel C++ compiler supports it too. So the non portability is just a theoretical issue. But thats not my question here. My MFC application is not portable by definition. So the question remains: Does it compile faster? If so and the code must be portable using both would be an option.
|
|
|
|