Recent

Author Topic: Making a DLL for rundll32  (Read 8942 times)

PaulANormanNZ

  • Full Member
  • ***
  • Posts: 117
Making a DLL for rundll32
« on: September 19, 2011, 01:20:51 pm »
Hi,

Has any one had experience with making a dll with Lazarus for rundll32 to use please?

I've read through ...

http://support.microsoft.com/kb/164787
http://vlaurie.com/computers2/Articles/rundll32.htm

And came across this remark from Peter Below (TeamB) borland.public.delphi.objectpascal and borland.public.delphi.winapi Usenet newsgroups:
 " there is in fact a program available on Win32 that will do that:
RunDLL32. There is in fact a way to pass parameters to the function but i have yet to see documentation for it. "

 I've  tried a few experiments, but no success so far.

Would C++  LPSTR lpszCmdLine just be a WideString?

Any pointers appreciated please.

Paul

BlueIcaro

  • Hero Member
  • *****
  • Posts: 834
    • Blog personal
Re: Making a DLL for rundll32
« Reply #1 on: September 19, 2011, 03:00:04 pm »

Laksen

  • Hero Member
  • *****
  • Posts: 802
    • J-Software
Re: Making a DLL for rundll32
« Reply #2 on: September 19, 2011, 05:06:41 pm »
Would C++  LPSTR lpszCmdLine just be a WideString?
No, it's a pointer to a null terminated string of ansi chars. LPWSTR is a pointer to a null terminated string of wide chars

PaulANormanNZ

  • Full Member
  • ***
  • Posts: 117
Re: Making a DLL for rundll32
« Reply #3 on: September 20, 2011, 12:11:25 am »
Thanks BlueIcaro, yes and I've had no problem so far actually making a dll that generally works, its getting things working with rundll32.

Thanks Laksen,  so LPSTR lpszCmdLine would cast to PChar?

The ansii table being basic ascii for its firts keyboard type members?

Paul

PaulANormanNZ

  • Full Member
  • ***
  • Posts: 117
Re: Making a DLL for rundll32
« Reply #4 on: September 20, 2011, 12:52:22 am »
I'll do some more checking first (that no one has done it  already), but I think I may end up writing my own executable(s) for running dll functions form the command line, then I can endeavour to make it cross platform as well, and make my dll's with companion .so's (codePilot cross compile?)

Very useful for calling from scripting engines that have a system call.

Paul

 

TinyPortal © 2005-2018