Results 1 to 30 of 30

Thread: question for penagate,moeur or codeblock pls regarding dll

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,364

    question for penagate,moeur or codeblock pls regarding dll

    this was codeblocks wrapper code to create a new link.exe regarding the win32dll. but im having problems with this

    VB Code:
    1. Option Explicit
    2.  
    3. Private Const LINK_FILE = "LINKER.EXE"
    4.  
    5. Dim FSO As FileSystemObject
    6.  
    7. Private Sub cmdCancel_Click()
    8.  
    9. Open App.Path & "\LinkerLog.txt" For Append As #1
    10.  
    11.     Print #1, Now & ": ============================================"
    12.     Print #1, Now & ": Command Line Options:   "; Command$
    13.     Print #1, Now & ": ============================================"
    14.     Print #1, vbCrLf & vbCrLf
    15.    
    16. Close #1
    17.  
    18. ShellWait App.Path & "\" & LINK_FILE & ".exe " & Command$
    19.     Unload Me
    20. End Sub
    21.  
    22. Private Sub CmdOk_Click()
    23.  
    24.     Dim CmdLine As String
    25.     CmdLine = Command$
    26.    
    27.     CmdLine = Replace(CmdLine, "/ENTRY:__vbaS", "/ENTRY:DLLMain") ' BookMark #1
    28.     CmdLine = Replace(CmdLine, "/BASE:0x400000", "/BASE:0x10000000")
    29.     CmdLine = CmdLine & " /DLL /DEF:" & """" & txtCompiler.Text & """"
    30.  
    31.     If Len(Dir(txtCompiler.Text, vbNormal)) <= 0 Then
    32.         MsgBox "No such DEF file.. please verify again!"
    33.         Exit Sub
    34.     End If
    35.  
    36.     LINK CmdLine
    37.    
    38. End Sub
    39.  
    40. Private Sub Form_Load()
    41.    
    42.     Dim intPos As Integer
    43.     Dim strPath As String
    44.    
    45.     Dim fld As Folder
    46.     Dim fil As File
    47.    
    48.     Set FSO = New FileSystemObject
    49.      
    50.      
    51.         ' Determine if .DEF file exists
    52.     '
    53.     ' Extract path from first .obj argument
    54.     intPos = InStr(1, Command$, ".OBJ", vbTextCompare)
    55.     strPath = Mid$(Command$, 2, intPos + 2)
    56.     intPos = InStrRev(strPath, "\")
    57.     strPath = Trim$(Left$(strPath, intPos - 1))
    58.     strPath = Replace$(strPath, """", "")
    59.    
    60.     Debug.Print strPath
    61.    
    62.     ' MsgBox "Path=" & strPath
    63.    
    64.     ' Open folder
    65.     Set fld = FSO.GetFolder(strPath)
    66.    
    67.     ' MsgBox fld.Path
    68.    
    69.     ' Get files in folder
    70.     For Each fil In fld.Files
    71.         ' MsgBox fil
    72.         If UCase$(FSO.GetExtensionName(fil)) = "DEF" Then
    73.            txtCompiler.Text = fil
    74.            Exit For
    75.         End If
    76.     Next
    77.    
    78.     If txtCompiler.Text = vbNullString Then
    79.         LINK  ' Default
    80.     Else
    81.         If MsgBox("Click Yes to apply DLL options over a Standard EXE Project," & vbCrLf & "otherwise click No to let VB handle the usual way.", vbYesNo) = vbNo Then
    82.             LINK  ' Default
    83.         End If
    84.     End If
    85. End Sub
    86.  
    87. Sub LINK(Optional CmdLine As String = vbNullString)
    88.  
    89. If CmdLine = vbNullString Then CmdLine = Command$
    90. If CmdLine = vbNullString Then
    91.     Unload Me
    92.     Exit Sub
    93. End If
    94.  
    95.     Open App.Path & "\LinkerLog.txt" For Append As #1
    96.  
    97.     Print #1, Now & ": ============================================"
    98.     Print #1, Now & ": Command Line Options:   "; Command$
    99.     If CmdLine <> Command$ Then
    100.     Print #1, Now & ": Command Line Options:   "; CmdLine ' Write only if there was a change
    101.     End If
    102.     Print #1, Now & ": ============================================"
    103.     Print #1, vbCrLf & vbCrLf
    104.    
    105.     Close #1
    106.    
    107.     ShellWait App.Path & "\" & LINK_FILE & " " & CmdLine ' i.e.: My SuperShell function
    108.     Unload Me
    109. End Sub

    Do i put this code in a *form* (i noticed CmdOK and CmdCancel functions in the code..) or a *module*?
    Do i add any references to the project?
    I keep getting an error with the 'shellwait' lines saing its not defined or something

    Please may someone help me with this. It's just the linker part which im having problems with, awaiting your replies, many thanks in advance!!

  2. #2
    Frenzied Member pnish's Avatar
    Join Date
    Aug 2002
    Location
    Tassie, Oz
    Posts
    1,918

    Re: question for penagate,moeur or codeblock pls regarding dll

    You need a reference to Microsoft Scripting Runtime to use the FileSystemObject and I'm guessing that ShellWait is a routine written by codeblock which shells to a process synchronously, ie waits for the process to finish before continuing. If I'm guessing correctly, this code should substitute for codeblock's ShellWait routine. Put this code in a module.
    VB Code:
    1. Option Explicit
    2. '
    3. '   Windows API Declarations for executing (shell) a process synchronously
    4. '
    5. Private Type STARTUPINFO
    6.     cb As Long
    7.     lpReserved As String
    8.     lpDesktop As String
    9.     lpTitle As String
    10.     dwX As Long
    11.     dwY As Long
    12.     dwXSize As Long
    13.     dwYSize As Long
    14.     dwXCountChars As Long
    15.     dwYCountChars As Long
    16.     dwFillAttribute As Long
    17.     dwFlags As Long
    18.     wShowWindow As Integer
    19.     cbReserved2 As Integer
    20.     lpReserved2 As Long
    21.     hStdInput As Long
    22.     hStdOutput As Long
    23.     hStdError As Long
    24. End Type
    25.  
    26. Private Const STARTF_USESHOWWINDOW As Long = &H1
    27. Private Const SW_HIDE As Long = &H0
    28.  
    29. Private Type PROCESS_INFORMATION
    30.     hProcess As Long
    31.     hThread As Long
    32.     dwProcessID As Long
    33.     dwThreadID As Long
    34. End Type
    35.  
    36. Private Const NORMAL_PRIORITY_CLASS = &H20&
    37. Private Const INFINITE = -1&
    38.  
    39. Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
    40.     (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
    41.     ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
    42.    
    43. Private Declare Function WaitForSingleObject Lib "kernel32" _
    44.     (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
    45.    
    46. Private Declare Function CreateProcessA Lib "kernel32" _
    47.     (ByVal lpApplicationName As Long, ByVal lpCommandLine As String, _
    48.     ByVal lpProcessAttributes As Long, ByVal lpThreadAttributes As Long, _
    49.     ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, _
    50.     ByVal lpEnvironment As Long, ByVal lpCurrentDirectory As Long, _
    51.     lpStartupInfo As STARTUPINFO, lpProcessInformation As PROCESS_INFORMATION) As Long
    52.    
    53. Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
    54.  
    55. Public Sub ShellWait(ByVal cmd As String, Optional Parameters As String = "", Optional ByVal HideWindow As Boolean = False)
    56.     '
    57.     '   Shell to a process and wait for it to finish executing
    58.     '
    59.     Dim ret As Long
    60.    
    61.     Dim proc As PROCESS_INFORMATION
    62.     Dim start As STARTUPINFO
    63.     '
    64.     '   Initialize the STARTUPINFO structure
    65.     '
    66.     start.cb = Len(start)
    67.     '
    68.     '   Hide the app's window if requested
    69.     '
    70.     If HideWindow Then
    71.         start.dwFlags = STARTF_USESHOWWINDOW
    72.         start.wShowWindow = SW_HIDE
    73.     End If
    74.     '
    75.     '   Check for any passed parameters
    76.     '
    77.     If Trim(Parameters) <> "" Then
    78.         cmd = cmd & " """ & Parameters & """"
    79.     End If
    80.     '
    81.     '   Start the shelled application
    82.     '
    83.     ret = CreateProcessA(0&, cmd, 0&, 0&, 1&, NORMAL_PRIORITY_CLASS, 0&, 0&, start, proc)
    84.     '
    85.     '   Wait for the shelled application to finish
    86.     '
    87.     ret = WaitForSingleObject(proc.hProcess, INFINITE)
    88.     ret = CloseHandle(proc.hProcess)
    89.    
    90. End Sub
    Pete

    No trees were harmed in the making of this post, however a large number of electrons were greatly inconvenienced.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,364

    Re: question for penagate,moeur or codeblock pls regarding dll

    ok thanks i done exactly what you said, plus i also put 2 buttons on the form (CmdOK and CmdCancel and a textbox - txtCompiler)..

    I did 'Make Project1.exe' and it successfully made the exe, now do i simply use this exe as the new Link.exe?

    (and change my original link.exe to LinkLnk.exe???)


    thanks for all your help so far

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,364

    Re: question for penagate,moeur or codeblock pls regarding dll

    ok a bit of success.. however after tryig to build my dll source, it doesnt seem to make my dll file in the directory?

    10/1/2005 2:16:14 AM: ============================================
    10/1/2005 2:16:14 AM: Command Line Options: "C:\Documents and Settings\Home\Desktop\MathLib_DLL\MathLib.OBJ" "C:\Documents and Settings\Home\Desktop\MathLib_DLL\MathLib1.OBJ" "C:\Program Files\Microsoft Visual Studio\VB98\VBAEXE6.LIB" /ENTRY:__vbaS /OUT:"C:\Documents and Settings\Home\Desktop\MathLib_DLL\MathLib.exe" /BASE:0x400000 /SUBSYSTEM:WINDOWS,4.0 /VERSION:1.0 /INCREMENTAL:NO /OPT:REF /MERGE:.rdata=.text /IGNORE:4078
    10/1/2005 2:16:14 AM: Command Line Options: "C:\Documents and Settings\Home\Desktop\MathLib_DLL\MathLib.OBJ" "C:\Documents and Settings\Home\Desktop\MathLib_DLL\MathLib1.OBJ" "C:\Program Files\Microsoft Visual Studio\VB98\VBAEXE6.LIB" /ENTRY:DLLMain /OUT:"C:\Documents and Settings\Home\Desktop\MathLib_DLL\MathLib.exe" /BASE:0x10000000 /SUBSYSTEM:WINDOWS,4.0 /VERSION:1.0 /INCREMENTAL:NO /OPT:REF /MERGE:.rdata=.text /IGNORE:4078 /DLL /DEF:"C:\Documents and Settings\Home\Desktop\MathLib_DLL\MathLib.DEF"
    10/1/2005 2:16:14 AM: ============================================
    it should have made MathLib.dll in the directory where the project is?

    when i was given this promp during the 'make MathLib.exe' -
    "Click Yes to apply DLL options over a Standard EXE Project"

    i clicked Yes, but the dll did not appear anywhere?? :confused: :confused: :confused:
    Last edited by Pouncer; Sep 30th, 2005 at 08:18 PM.

  5. #5
    Frenzied Member pnish's Avatar
    Join Date
    Aug 2002
    Location
    Tassie, Oz
    Posts
    1,918

    Re: question for penagate,moeur or codeblock pls regarding dll

    I'm not exactly sure what's happening... sorry
    Maybe you could try sending codeblock a PM seeing as it's his code.
    Pete

    No trees were harmed in the making of this post, however a large number of electrons were greatly inconvenienced.

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,364

    Re: question for penagate,moeur or codeblock pls regarding dll

    ok it builds it into a .exe now, not a dll

    i chose 'yes' from the linker option to create as a dll, but still it makes an exe in the directory

    any ideas whats going wrong guys?

    This is the linker im using:
    Attached Files Attached Files

  7. #7
    Old Member moeur's Avatar
    Join Date
    Nov 2004
    Location
    Wait'n for Free Stuff
    Posts
    2,712

    Re: question for penagate,moeur or codeblock pls regarding dll

    did you try renaming the exe to dll?

  8. #8

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,364

    Re: question for penagate,moeur or codeblock pls regarding dll

    ok i changed the exe to a dll, and then i made a brand new exe testing the dll, but it just keeps saying 'can't find the MathLib.dll'

    Please can help me, i am desperate to get this working, thanks alot for all your help so far, this is the dll project and the dlltest project, please if you have time look at it, thanks
    Attached Files Attached Files

  9. #9
    Old Member moeur's Avatar
    Join Date
    Nov 2004
    Location
    Wait'n for Free Stuff
    Posts
    2,712

    Re: question for penagate,moeur or codeblock pls regarding dll

    If it can't find Mathlib.dll try moving it to your system32 directory

  10. #10

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,364

    Re: question for penagate,moeur or codeblock pls regarding dll

    i still getting:

    run time error 48

    file mathlib.dll not found


  11. #11
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: question for penagate,moeur or codeblock pls regarding dll

    What did you move. Mathlib or your "dll" into system32? If it says its looking for Mathlib, then thats what you need to put in system32.

    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

  12. #12

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,364

    Re: question for penagate,moeur or codeblock pls regarding dll

    i pasted a copy of the MathLib.dll into the system32 folder, and it just keeps saying

    run time error 48

    file not found: MathLib.dll

  13. #13
    Old Member moeur's Avatar
    Join Date
    Nov 2004
    Location
    Wait'n for Free Stuff
    Posts
    2,712

    Re: question for penagate,moeur or codeblock pls regarding dll

    I can't help you with codeblock's wrapper, but if you want to try the one I poseted in that thread I can help.

  14. #14

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,364

    Re: question for penagate,moeur or codeblock pls regarding dll

    ok thanks, i used your wrapper code - i built it into link.exe and renamed the other original one to LinkLnk.exe. I put these in the vb directory..

    i then do 'Make MathLib.exe", it asks me..

    Make changes to link options, i click 'Yes' , and it creates MathLib.exe in the project directory.

    i then change it to MathLib.dll

    but im getting the same problem as before when i test the dll, i get a run time error saying the MathLib.dll was not found. :confused:

    This is from lnklog.txt

    Beginning execution at 10/1/2005 9:12:38 PM

    Command line arguments to LINK call:

    "C:\Documents and Settings\Home\Desktop\MathLib[Test]\MathLib_DLL\MathLib.OBJ" "C:\Documents and Settings\Home\Desktop\MathLib[Test]\MathLib_DLL\MathLib1.OBJ" "C:\Program Files\Microsoft Visual Studio\VB98\VBAEXE6.LIB" /ENTRY:__vbaS /OUT:"C:\Documents and Settings\Home\Desktop\MathLib[Test]\MathLib_DLL\MathLib.exe" /BASE:0x400000 /SUBSYSTEM:WINDOWS,4.0 /VERSION:1.0 /INCREMENTAL:NO /OPT:REF /MERGE:.rdata=.text /IGNORE:4078


    Command line arguments after modification:

    "C:\Documents and Settings\Home\Desktop\MathLib[Test]\MathLib_DLL\MathLib.OBJ" "C:\Documents and Settings\Home\Desktop\MathLib[Test]\MathLib_DLL\MathLib1.OBJ" "C:\Program Files\Microsoft Visual Studio\VB98\VBAEXE6.LIB" /ENTRY:DLLMain /OUT:"C:\Documents and Settings\Home\Desktop\MathLib[Test]\MathLib_DLL\MathLib.exe" /BASE:0x10000000 /SUBSYSTEM:WINDOWS,4.0 /VERSION:1.0 /DEF:"C:\Documents and Settings\Home\Desktop\MathLib[Test]\MathLib_DLL\MathLib.def" /DLL /INCREMENTAL:NO /OPT:REF /MERGE:.rdata=.text /IGNORE:4078


    Calling LINK.EXE linker

    Returned from linker call
    Last edited by Pouncer; Oct 1st, 2005 at 03:15 PM.

  15. #15
    Old Member moeur's Avatar
    Join Date
    Nov 2004
    Location
    Wait'n for Free Stuff
    Posts
    2,712

    Re: question for penagate,moeur or codeblock pls regarding dll

    Pouncer,
    I am working on it
    I have to get my brain back to where it was when I last worked on this problem.
    One thing I remember is that if the VB linker runs into an error, it won't give you an error message, it simply does not produce the output file.
    To get the error messages, I have to run the command through the VC++ linker in a CMD window. The command being the command line after modification from the log file.
    You have to do this at the point that the link wrapper is asking you whether you want to proceed or not other wise the obj files will not exist.
    Also, when you compile your exe, you can give it the dll name.
    Last edited by moeur; Oct 2nd, 2005 at 11:32 AM.

  16. #16

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,364

    Re: question for penagate,moeur or codeblock pls regarding dll

    moeur thanks you so much for all your time and effort for this, i really hope you can solve this problem!!

    thanks alot, ill keep checking back on this thread

  17. #17
    Old Member moeur's Avatar
    Join Date
    Nov 2004
    Location
    Wait'n for Free Stuff
    Posts
    2,712

    Re: question for penagate,moeur or codeblock pls regarding dll

    OK, I got your code working with my wrapper.
    If you are using my wrapper then decalre your dllmain function as so.
    VB Code:
    1. Public Function DllMain(ByVal hInst As Long, ByVal fdwReason As Long, lpvReserved As Long) As Long
    Note case matters.

    Now, I think your problem was that you have declared the path to your dll in the declaration of the functions.
    VB Code:
    1. Public Declare Function Increment Lib "C:\Documents and Settings\Home\Desktop\MathLib_DLL\MathLib.dll" (value As Integer) As Integer
    Make sure that the dll resides in that directory and delete all other instances.

  18. #18

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,364

    Re: question for penagate,moeur or codeblock pls regarding dll

    wow moeur thats brilliantt!!!! you got it working on your side now i know there is 100% hope!!!!

    but on my side, im using your wrapper code and done exactly as you wrote, i clicked on 'Make MathLib.dll' and i clicked yes on the prompt: 'Make changes to link options'

    but it does not produce no MathLib.dll in the direcotry of the project

  19. #19
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: question for penagate,moeur or codeblock pls regarding dll

    Quote Originally Posted by Pouncer
    i pasted a copy of the MathLib.dll into the system32 folder, and it just keeps saying

    run time error 48

    file not found: MathLib.dll
    What OS are you using? You should only move it to System32 if it's XP, 2000, or NT. Otherwise it should be in your System folder.

  20. #20
    Old Member moeur's Avatar
    Join Date
    Nov 2004
    Location
    Wait'n for Free Stuff
    Posts
    2,712

    Re: question for penagate,moeur or codeblock pls regarding dll

    but it does not produce no MathLib.dll in the direcotry of the project
    Did you declare your DllMain exactly as I posted it? Cut and paste that declaration so that you don't make a type. The case of DllMain is important. My wrapper expects DllMain not DLLMain as codebank's wrapper expects.

  21. #21

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,364

    Re: question for penagate,moeur or codeblock pls regarding dll

    i check the code over and over and it is exactly how you wrote, i use DllMain in your linker and your exact dll declaration (which i pasted as you said), i cant seem to find the problem at all (im on win xp too, i looked in system32 and dll isnt there either)

    here is everything, the dll, the project to test the dll, moeurs linker

    but it just isnt producing the dll
    Attached Files Attached Files

  22. #22
    Old Member moeur's Avatar
    Join Date
    Nov 2004
    Location
    Wait'n for Free Stuff
    Posts
    2,712

    Re: question for penagate,moeur or codeblock pls regarding dll

    Oh,

    I forgot

    Remove the following line from your .def file
    DLLMain @1
    so the file should read
    Code:
    LIBRARY MathLib
    
    EXPORTS 
            Increment @1
            Decrement @2
            Square @3

  23. #23

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,364

    Re: question for penagate,moeur or codeblock pls regarding dll

    moeur you are a absulute genius, i dnt know how much to thank you. and also the others too like penegate who kept replying back on the other thread.

    ive made activex dlls before in vb, but never did i think it would be possible to create windows dll until penegate linked me to your hook thread

    once again, thanks very much, im not gona test this windows dll from a different application, like an irc chat client - mIRC.

    you help was much appreciated!!

  24. #24

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,364

    Re: question for penagate,moeur or codeblock pls regarding dll

    ok well, testing this dll in an irc chat client called mIRC, using something like

    //echo -a $dll(MathLib.dll,Square,4)

    (I put MathLib.dll in the directory to where the mIRC client is)

    which should echo 16 in the client

    but it crashes mIRC and this is the message i get, any ideas as to what is causing this



    This is the dll help guide from mircs documentation
    Technical notes
    This section contains technical information for programmers who want to create DLLs for use with mIRC.

    The routine in the DLL being called must be of the form:

    int __stdcall procname(HWND mWnd, HWND aWnd, char *data, char *parms, BOOL show, BOOL nopause)

    mWnd is the handle to the main mIRC window.

    aWnd is the handle of the window in which the command is being issued, this might not be the currently active window if the command is being called by a remote script.

    data is the information that you wish to send to the DLL. On return, the DLL can fill this variable with the command it wants mIRC to perform if any.

    parms is filled by the DLL on return with parameters that it wants mIRC to use when performing the command that it returns in the data variable.

    Note: The data and parms variables can each hold 900 chars maximum.

    show is FALSE if the . prefix was specified to make the command quiet, or TRUE otherwise.

    nopause is TRUE if mIRC is in a critical routine and the DLL must not do anything that pauses processing in mIRC, eg. the DLL should not pop up a dialog.

    The DLL can return an integer to indicate what it wants mIRC to do:

    0 means that mIRC should /halt processing

    1 means that mIRC should continue processing

    2 means that it has filled the data variable with a command which it wants mIRC to perform, and has filled parms with the parameters to use, if any, when performing the command.

    3 means that the DLL has filled the data variable with the result that $dll() as an identifier should return.

    Note: You may need to create a .def file with the procedure names exported when compiling your DLL
    Last edited by Pouncer; Oct 2nd, 2005 at 02:46 PM.

  25. #25
    Old Member moeur's Avatar
    Join Date
    Nov 2004
    Location
    Wait'n for Free Stuff
    Posts
    2,712

    Re: question for penagate,moeur or codeblock pls regarding dll

    The document says that your function should have the form
    VB Code:
    1. Public Function Square(ByVal mWnd as Long, ByVal aWnd as Long, ByVal strdata as String, _
    2. ByVal parms As String, ByVal show as Long, ByVal nopause as Long) as Long

    Is this what you have?

  26. #26

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,364

    Re: question for penagate,moeur or codeblock pls regarding dll

    Thanks for the reply, I just have

    VB Code:
    1. Public Function Square(var As Long) As Long
    2.    If Not IsNumeric(var) Then Err.Raise 5
    3.    
    4.    Square = var ^ 2
    5. End Function

    Should I change that to add in the variables you just posted? I.e,

    VB Code:
    1. Public Function Square(ByVal mWnd As Long, ByVal aWnd As Long, ByVal strdata As String, _
    2. ByVal parms As String, ByVal show As Long, ByVal nopause As Long, var As Long) As Long
    3.  
    4.    If Not IsNumeric(var) Then Err.Raise 5
    5.    
    6.    Square = var ^ 2
    7. End Function

    (I put the val variable at the end)

    Edit* Just tried it, the square functions stop working in the dll, and still the same crash problem from mIRC
    Last edited by Pouncer; Oct 2nd, 2005 at 04:40 PM.

  27. #27
    Old Member moeur's Avatar
    Join Date
    Nov 2004
    Location
    Wait'n for Free Stuff
    Posts
    2,712

    Re: question for penagate,moeur or codeblock pls regarding dll

    Since I don't know anything about the $dll function I can't help.
    One problem could be that you probably can't call your dll from non-VB programs.

  28. #28

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,364

    Re: question for penagate,moeur or codeblock pls regarding dll

    This was a small example mIRC dll (in c++ which i think you know fairly well)

    http://www.team-clanx.org/articles/c...l%20tutor.html

    I'm not sure but thats how the functions are in c++, but if this is a windows 32 dll, shouldnt it be accessible from any application?

  29. #29
    Old Member moeur's Avatar
    Join Date
    Nov 2004
    Location
    Wait'n for Free Stuff
    Posts
    2,712

    Re: question for penagate,moeur or codeblock pls regarding dll

    As mentioned in the thread about this topic, the dll is still not a true win32 dll. First of all, the dll doesn't initialize properly and second it needs to initialize all the VB runtime stuff. It won't do the later so it must be called from a VB app that has already initialized all the COM stuff.

  30. #30

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,364

    Re: question for penagate,moeur or codeblock pls regarding dll

    ok thanks alot for your help, i guess i need to move into the C++ area!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width