|
the dynamic-loading way didn't work!!!i don't know why..
i get this error:
run-time check failure #0 - the value of ESP was not properly saved across a function call. this is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
note:the functions in the dll use _stdcall convention to be used with VB...
|
|
|
|
|
See if this article helps.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
This reminds me of MY current problem, where I need to put some functions in a DLL AND dynamically link to my own functions just to call two Microsoft APIs.
I need to know if there are instances of MSDE on a machine.
Using the 'preferred' functions NumInstalledInstances and IsInstanceNameValid.
These are in a static LIB file you link against. That's fine.
But, when you execute them, they need a DLL that is only installed if the machine ALREADY has one or more of their dependent MSDE DLLs.
So, if you want your EXE to load, you can't directly link with these functions, and so you put the functions in a DLL, but you can't statically link with your own DLL either, or you will still end up requiring the MSDE DLLs to load. So, you put the functions in your own DLL (which is statically linked to the Microsoft API), export some functions similar to the 'static' functions from the Microsoft API, and then DYNAMICALLY get the procedure address at runtime of your own two functions after dynamically loading your own DLL.
Yeeeeeehaw! Aint this fun!
|
|
|
|
|
i got a headache of that..i'm a newbee to these stuff so please give me some more details about what to link statically and what to link dynamically..
i'm using static linking between my c++ dll and APIs contained in it.and using the usual Declare statement in VB to call my dll's functions..what necessary steps i need to make to solve the problem..
note:the article suggests writnig something like:
typedef BOOL (* _stdcall fnptr) (HWND, COLORREF, BYTE, DWORD);
but this didn't work either..
|
|
|
|
|
The code wihtint he C++ DLL needs to load the library, like suggested earlier, then use GetProcAddress to obtaint he function from it, and only call the function if it gets the address, otherwise, you are on a version of the OS that doe snot have the function supported yet.
Something like this:
VB can statically link to C++ DLL
C++ DLL dynamically loads library and gets procedure address
If procedure address exists, then function is called, otherwise, it is not (obviously..)
Then it will work, and you can load your VB application without the error about 'function not found' coming up.
|
|
|
|
|
it's not working man...
i uploaded the project so you can download it and see what's wrong...
after downloading you should build the dll and build the VB example project to the debug folder...
the project
|
|
|
|
|
that's is fantastic...i don't know how to thank you..
this forum is the best and you people are the best...
|
|
|
|
|
Hai frenz. . .
I face a prblm in Modeless dialog. . .
The modeless dialog will appear in front of the parent window.If i select the parent window the dialog will lose it control to parent but it will still remain infront of parent.
Can any one guide me how to over come this prblm. . .
Expecting urs replies
|
|
|
|
|
didn't you set an option like "always visible" or something like that ?
TOXCCT >>> GEII power
|
|
|
|
|
That's the behaviour one usually wants from a modless dialog. What is it you want to accomplish? Should it be dismissed, moved to the background, minimized... ?
|
|
|
|
|
The child dialog has to go back or get minimized. . .
|
|
|
|
|
Set the dialogs parent/owner to be the desktop window.
Without knowing much about your application, this behaviour seems rather confusing.
|
|
|
|
|
Is this possible to make such an appl in pure C++ ?
If so, please tell me how - at least which func
should I use.
Thank you for help in advance.
_________<br />
I'm made in C++... and I'm proud of it!
|
|
|
|
|
Micie wrote:
Is this possible to make such an appl in pure C++ ?
1 - make what ?
2 - Everything is possible in C, so in C++.... express yourself even better
TOXCCT >>> GEII power
|
|
|
|
|
Doh. How can I make the residental app in C++ ?
Give me sample code or something
_________<br />
I'm made in C++... and I'm proud of it!
|
|
|
|
|
hm let me see,
i'm not an expert on this, but i'd say that you must create a program that is loaded at windows start (or session start - search for the keys in the registry), and that could (or not) have an icon in the system tray...
if you like, you could loook on code project for articles on the subject, i'm quite sure it has already been treated...
see u
TOXCCT >>> GEII power
|
|
|
|
|
Hah! Thanks for help!
The thread is still open, do not hesitate to post
any yr suggestion about it.
_________<br />
I'm made in C++... and I'm proud of it!
|
|
|
|
|
What is a "residental application?"
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I my dictionary I found it as application which works in background of system. It starts mostly before starting of system. Do u know other name for such application ?
If so, please post it here.
_________<br />
I'm made in C++... and I'm proud of it!
|
|
|
|
|
The term "background application" is a holdover from the days of Unix and DOS (see TSR). It is meaningless within Windows because of its multitasking capabilities.
That said, what exactly is it that you are trying to accomplish?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I want to do for my parents an app which will log to file every application which run on it. My parents have an office - they want to prevent from using chattin' tools in it so they asked me. It have to work in background, otherwise it can be easily closed what will cause stopping of logging.
_________<br />
I'm made in C++... and I'm proud of it!
|
|
|
|
|
Thanks, that makes more sense!
Unless you are one with the OS, I don't not believe there is a foolproof way of keeping someone from shutting down your application if they really want it shut down. For the most part, this sort of application works great for the (semi) honest person. If a person is a guru and is determined to play a game, IM, etc, they will find a way around such barriers.
I've run into some tough spyware issues in the past but the one that impressed me most was comprised of two applications. From my observations, it appeared as though each was programmed to (once per second?) watch out for the other so that if one was shut down, the other would start it back up and vice-versa. Given that you can only shut down one application at a time via Task Manager (I'm sure there are other utilities out there that allow this), there was no way for me to shut them down at the same time. After about 45 minutes of trying everything I could think of, I finally rid the machine of the spyware. The guy whose machine I was working on was in awe/disbelief at how deep things could get in regards to spyware and the like. I think a bit of his naivety was removed that day.
What OS are we talking about here? If it is at least Windows 2000, you could put some policies in place that would lock the OS down pretty well. Policies/permissions are a very underutilized feature in my opinion. You can uninstall all but the necessary applications, keep other applications from being installed, restrict access to the CD and floppy drives, etc. All this can be done without an ounce of code.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I'm using here win[sh*t]98... and I want to write an app, you can ask why. Here's the answer: I want to practise my programming skills and.. this app will work in my parents office - they just want to have a proof if some1 is using chattin' app like MSN, ICQ etc., also this app will log every WWW title to the file - than we will know what was she/he doing and when. Do you know how to help me?
I'm going now - be back tomorrow -.- I'm from europe! It's 18:26 now thought... have to go to home and make my homeworks [I'm just 18years-old.. hah!]. Keep posting! I'll be back tomorrow and I'll read everything !
_________<br />
I'm made in C++... and I'm proud of it!
|
|
|
|
|
Micie wrote:
I want to practise my programming skills...
An admiral goal.
Micie wrote:
...they just want to have a proof if some1 is using chattin' app like MSN, ICQ etc.
Some of these chat-type programs communicate on a specific port. If you can configure the firewall to block those ports, problem solved.
Micie wrote:
...also this app will log every WWW title to the file
This would require the creation of a Browser Helper Object (BHO).
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I ran into this with the Xupiter Spyware/Malware or whatever that CRAP was.
Only it had THREE programs doing this.
My trick was to stop one and have an explorer window OPEN to the folder where the EXE file was located. Once stopping it, I immediately deleted the EXE file.
Then I went onto the next one.
There were some DLLs loaded by IE and locked in memory that were a little tricker, and they resurrected one or two of the EXE files.
So.... I wrote a custom tool that has a file browser.
Any file I select gets added to the 'delete at restart' of Windows.
So, I added a bunch of the DLL files from Xupiter to this kill list, and the EXE files.
When I rebooted, it was mostly gone, then it was some manual cleanup of the registry.
Have not seen it since.
|
|
|
|