About the closest thing that I can think of would be to do something like export a function from your DLL, say "Init". Then you could use RunDll32.exe to call that exported function with the parameters.
MSDN for RunDll32:
The Run DLL utility (Rundll32.exe) included in Windows enables you to call functions exported from a 32-bit DLL. These functions must have the following syntax:
Code:
void CALLBACK EntryPoint(
HWND hwnd, // handle to owner window
HINSTANCE hinst, // instance handle for the DLL
LPTSTR lpCmdLine, // string the DLL will parse
int nCmdShow // show state
);
Note that EntryPoint is a placeholder for the actual function name. For a list of possible show states, see WinMain.
The following is the command-line syntax for Rundll32:
Code:
rundll32 DllName,FunctionName [Arguments]
Cool?
Thought for the day/week/month/year: Windows System Error 4006:
Replication with a nonconfigured partner is not allowed.
Originally posted by myth7676
I have a .dll, say test.dll and i want to call this .dll like:
test.dll /filename /start address.
That's what an exe is for. Why don't you use an exe instead of a DLL? Note that you can export functions from an exe and call them as if the exe was a DLL.
Originally posted by gstercken
That's what an exe is for. Why don't you use an exe instead of a DLL? Note that you can export functions from an exe and call them as if the exe was a DLL.
I can think of a small handful of reasons why one might wish to do something like this with a DLL, but in general I agree that an EXE would be a better way to go.
Originally posted by myth7676
Can you show me how can i do that(export functions), please?
I believe you would do it the same way you would export a function from a DLL... Via DEF file or _declspec( dllexport )...
Thought for the day/week/month/year: Windows System Error 4006:
Replication with a nonconfigured partner is not allowed.
Originally posted by vicodin451
I can think of a small handful of reasons why one might wish to do something like this with a DLL, but in general I agree that an EXE would be a better way to go.
I believe you would do it the same way you would export a function from a DLL... Via DEF file or _declspec( dllexport )...
You know, marsh, I have this suspicion you might be acting a little sarcastically. Overstating things a bit. Because the way I see it, a couple of choice API interceptions (probably NtCreateProcess to detect for dll and map into a process properly, along with maybe some routines like LdrLoadDll to support their use in a process without an executable), coupled with supplying one's own _CRTDllMain (or whatever you want to call it) which will walk through the processes PEB to get the location of the command-line arguments, and it seems to me you are pretty much there. No need to ever even touch HAL or mess with the PnP manager...
*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/
"It's hard to believe in something you don't understand." -- the sidhi X-files episode
Originally posted by marsh_pottaye
I'm wonderig what you got. Because the conclusion here is as far from your initial wish as F16 key from F1.
Still consider Windows re-writing.
Well, well, well March,
It seems to me or you're a little bit sarcastic here? Then again maybe it's just my imagination...
What I got was a very good idea, this is what I've got.
I had one idea in the start, then people that know better this things changed my mind and now i have a solution that works fine for me. Do you have a problem with that?
If you do, then make yourself a viable suggestion, instead of just throwing pieces of info from your last neuron alive "Re-write Windows, Re-write Windows...". These things are neither constructive, nor interesting for anyone.
If you consider that they are, maybe you are in the wrong forum, maybe you want it to sign up for CartoonNetwork and by accident you ended up here...?
PS: I was thinking about F16 fighter, not at the F16 key.
..Now I'm sure that you're in the wrong forum.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.