|
You cannot use LoadLibrary to load a remote DLL .
You must call LoadLibrary on the local machine wherein the DLL is.
For instance, COM allows you to call methods of remote components hosted in DLL s because it creates a stub process in the machine wherein the DLL s are.
Veni, vidi, vici.
|
|
|
|
|
So I accept I have to use DCOM instead of the "simple" LoadLibrary
Can you please point me to a code example/tutorial on how I call methods in my remote DLL (not .exe)using DCOM?
Alternatively add a code example?
More details:
I own an application running on one computer. There I can add code to access the dll methods. I will also write the dll.
I do not own the other application that will access my dll locally using LoadLibrary.
The functions will be simple. I will send data repetitively to the dll.
Thank you!
Pia
|
|
|
|
|
Actually you don't need DCOM (you may use it if you like), you may use RPC s or implement you own TCP mechanism to communicate with the remote executable that loads the DLL .
CodeProject has some articles[^] about DCOM .
Veni, vidi, vici.
|
|
|
|
|
Which way is the simplest/easiest to learn and create?
Do you have a code example of which function calls I have to make?
|
|
|
|
|
I don't know, after all it depends on your requirements. You could read some articles here at CodeProject (either on DCOM or RPC or TCP client/server programming) and then choose the technique that better fits your need.
Veni, vidi, vici.
|
|
|
|
|
|
I think you should have searched CodeProject at least now.
|
|
|
|
|
You have two computers A and B.
Executables run on A.
Executables run on B.
You cannot make anything run on B 'magically'.
When two computer 'talk' then both computers must be running something.
Now you can do the following.
1. Write a server, call it T. The server, code you wrote, loads a dll when a command is 'sent' to T. Not that the server must follow all of the restrictions for loading a dll into an application.
2. Write a client, call it M. That client sends the command to T.
Given the above then:
A must run M (client)
B must run T (server)
AFTER that, then B can, vian the client T, cause A to load a dll.
Restating it again, there is NO way to 'magically' make a dll load onto another computer. There MUST be a server of some sort running on the remote computer.
|
|
|
|
|
Hi every one
I have simple code and think and ask other for 2 weeks . And now i have found out how to fix it yet . When I click button for first dialog , it is ok to show another dialog . But when I click button in that dialog in order to show message or do anything else , no thing happens . I follow basic way to add event . First resource and then add class , at last add event handler . But many times ,it does not work ! .
http://www.mediafire.com/?8pppqsnbglzrvb2[^]
Thank you
hi world
|
|
|
|
|
Perhaps I need to approach this in a different way.
This program has exactly the same error, and with a variable named just like last time 'hienthi'
This function has the problem. How was it created? Was it automatic, or did you add the code by hand?
void ChandlerDlg::OnBnClickedButton1()
{
CDialog hienthi(IDD_DIALOG1);
hienthi.DoModal() ;
}
|
|
|
|
|
It is correct and I add by writing directly .
It is alright because when you click into button in first dialog , it show this dialog hien thi . So error is not in this code .
Thank you
hi world
|
|
|
|
|
Okay sure, you added the code by hand.
What makes you think that it is correct?
You don't want an object of type CDialog that has the appearance of your IDD_ABOUTBOX - You want an object of type CAboutDlg.
Just because the dialog looks like your about box, doesn't mean that it has the message_map connected to it or any other event handlers for that matter.
In fact, the only reason that the OK button works is because it already has the ID of IDOK - an ID that is handled by windows and causes the dialog to be closed.
I'll repeat again - your code IS incorrect!
You need to create an object of type CAboutDlg, then call DoModal on it. simple!
Consider the following:
Your dialog is of class CAboutDlg. This inherits from CDialog.
You can't expect to create a CDialog and have it behave like a CAboutDlg, since CDialog knows nothing of the internals of CAboutDlg.
|
|
|
|
|
Thank you ,
Have nice day ! .
hi world
|
|
|
|
|
Ah
I have found out problem . I must use Dialog1 . You are right . Thank you
hi world
|
|
|
|
|
Hi.
I created a short video that shows every step from when the File->New->Project menu option is selected until the app is (successfully) run.
It's 5 mins, 3MB and can be found here[^]
|
|
|
|
|
Thank you a lot
So the error is I forgot the class attached to Resource ID . I must call that class . This make me confused ! . And it is very basic .
By the way , it got out experience from this , try avoid using directly the IDD because it can appear but only for fashion only .
Thank a lot , Nice day ! .
hi world
|
|
|
|
|
Cheers
Top of the day to you too!
|
|
|
|
|
It seems that the following format "%f\n" for reading a double not working. Please help:
fscanf( f_ptr_seed_inf,"%f\n",&sam_interval);
Thanks
|
|
|
|
|
Start here. Then look for double
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
In the future... describe what you mean by "not working". Think about it, if you were a mechanic and I told you "my car isn't working", would you know what's wrong?
|
|
|
|
|
the driver of course.
|
|
|
|
|
I use lmgtfy these days where I previously would have said RTFM.
Cheers,
Peter
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
|
In the application that I am working on, the main screen has a toolbar with 10 buttons on it. Those buttons represent various actions (e.g, clock in, gone to lunch) that the user can take. The user has control over which image they want assigned to which button (based on the button's action). There are 50+ bitmaps to choose from. My interface thus far for this is a list control with an image list housing the 10 bitmaps currently in use. When an image in the list control is clicked, information about the button's action (7-8 other controls) is displayed in the lower half of the dialog. That information, including the image, can be changed.
The predecessor to this application, which is around 10 years old, just had a "change image" push button that displayed another dialog. This second dialog simply had a listbox with the names of the bitmaps in it. The currently selected bitmap was displayed in some sort of picture control above the list. If you can envision this from my description, it's rather dull and old feeling. What I'm looking for is a "modern" way of being able to change the bitmap assigned to the toolbar button.
Can you toss some ideas out on the table of ways you can think of that would make this scenario a little less Borland/Ctl3d feeling? My job still requires me to use VS6 so I'm not up-to-date on all of the latest UI elements that VS (and Windows 7) offers. I've played around with VS2008 for some personal and proof-of-concept stuff, but nothing mainstream.
Thanks.
- DC
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Well, the good thing about C++ is that you can make your own controls... and draw everything however you want (of course, this involves you programming it yourself, hope you're good with GDI... ).
Since you're just changing icons, how about a right click option that loads a handful of icons at a time along with their labels (sort of like a menu pulldown with icons)? This is very doable in studio 6 but you'll have to program the icon loading yourself, the menu display portion is relatively straightforward (you can make a static menu with all the options, then just load the icons).
Another option would be to make a window with no borders that just has a number of icons on it for the user to select from. You can probably also tie that in to a right-click or something like that.
|
|
|
|