PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: [SOLVED] Problem loading PB DLL in VB6 IDE  (Read 1098 times)

Joakim Schramm

  • Little Newbie
  • *
  • Posts: 38
  • FF3 User
[SOLVED] Problem loading PB DLL in VB6 IDE
« on: December 17, 2010, 03:11:00 PM »

I like to start my search solving this problem here rather on the PB forum as the dll is created in FF 3.10, so it's excluded being a FF problem, which currently I'm not sure about.

The problem is basically this, the dll is called from my VB6 app and in the compiled exe all is working as it should, dll loads and all exported functions are available w/o problems. But when I run the app in VB6 IDE, on first call to any exported function I get an "Run-time error '53': File not found: acjAtlasEx.dll".

I have other PB dll projects compiled and called (loading) w/o problem in the IDE from within the same VB6 app, so I'm a bit puzzled but what differs in the failing project is that it includes a gui form and I suspect that's at least part of the problem. However I thought if this was caused by the gui code in any way there ought to be some error generated from the dll on loading but I placed a Trace in FF_LIBMAIN and I can't see that code it triggered ever so it have to be something sticking out on a deeper level I don't know how to trace, and that's where I turn to you guys (and girls if here are any) and ask if something may pop in to the forehead?

My environment is as follow: Win 7 Ultimate 64, VB6 Pro (old I know), PB WIN 9.05, FF 3.10, WIN API JR 1.17 Includes

I know the "classic" problem/solusion is with ALIAS but I'm pretty sure it's not the case here as I have tested to call the most simple and aliased function to no avail. Possibly it has to do with Win 7 64 or Win 7 in general but google around I haven't been able to find anything reminding about it, UAC is off so not that either... I know if nothing else I have to dismantle the whole dll and put it together peace by peace to possibly find the weak spot, but hopefully someone has an idea that at least can limit that work.

TIA,

Joakim
« Last Edit: December 22, 2010, 02:17:09 PM by Joakim Schramm »
Logged

Robert Eaton

  • Junior Member
  • **
  • Posts: 126
Re: Problem loading PB DLL in VB6 IDE
« Reply #1 on: December 20, 2010, 10:52:33 AM »

Maybe try putting a copy of the dll in the VB6 program folder (VB98) ??
Logged

Joakim Schramm

  • Little Newbie
  • *
  • Posts: 38
  • FF3 User
Re: Problem loading PB DLL in VB6 IDE
« Reply #2 on: December 22, 2010, 07:54:02 AM »

Maybe try putting a copy of the dll in the VB6 program folder (VB98) ??
Thanks for suggestion but no it doesn't help. I'm pretty sure it's not a path issue as other dll's I compile are found and loads from same location, it's something with the dll in itself.

I have now identified yet another dll I compile with FF3 having the same issue and this one doesn't include any GUI stuff, so that's probably not the issue. Looking at what these 2 dll's that "can't be found" by VB6 IDE have in common and diverse from the working ones, they both load a resource file with strings and they both have a module loading definitions for the Tsunami Record Manager 3.5 Pro

I would put my vote on the rc stuff as I do it in an non standard way as I don't quite understand the PB-way to do it and this must somehow affect the dll entry point as it have to be the dll entry point that VB6 cannot "see" for some reason.

This is how I do the resource stuff, and probably I do it wrong as I pretty much don't understand the FF way to do it either ;-)

I usually put my resource stuff in a dll created by the excellent app Resource Builder but as this already is a dll I thought to have it right there already. So in FF I go to the Project menu and pick "Add Resource File" and add my chlang.rc file to start with. I think have a global variable

Code: [Select]
Global hModule  As Long      'handle to the lang .DLL
and not in FF_LIBMAIN but in an exported function I call to init the dll I have

Code: [Select]
hModule = GetModuleHandle("acjChartsEx.dll")
which mean the dll basically load itself and well this seem wrong to me but was the only way I could get the dll to find the resource file I loaded into FF.

If I then get a module handle I go along to set some variables conserning offsets etc. and then I get the string from
Code: [Select]
Function GetString(lngStringID As Long) As String
   Local nChars As Long
  Dim szString As Asciiz * 4096
  nChars = LoadString(hModule, lngLangOffset + lngStringID, szString, SizeOf(szString))
  Function = szString
End Function

I believe there probably is a better way to deal with the loaded RC file but I found nothing about it in the FF help file and not in the forum either (when search at the time I set this up).

So if someone can tell of a more direct way to use the resource file loaded by FF, that may be the solution or at leasta step in the right direction.

Thanks

/Joakim


EDIT: Did another research on resources and replaced
Code: [Select]
hModule = GetModuleHandle("acjChartsEx.dll")with
Code: [Select]
hModule = app.hInstancebut no difference and as I now think I have the resource handling correct (?) it should at least count it out as what causes the problem.
« Last Edit: December 22, 2010, 08:35:05 AM by Joakim Schramm »
Logged

Joakim Schramm

  • Little Newbie
  • *
  • Posts: 38
  • FF3 User
Re: Problem loading PB DLL in VB6 IDE
« Reply #3 on: December 22, 2010, 01:14:27 PM »

So I managed to pin point the problem :-) which is that just including any call to a TRM (Tsunami Record Manager) function in the code makes the dll "invisible" to VB6 IDE :-( and most likely it's due to me running  64 bits version of Windows 7 as this what never a problem before when using Windows XP (32) which in turn, I am afraid, leads to the conclusion this is an unsolvable problem as it appears TRM is no more :-(
Logged

Joakim Schramm

  • Little Newbie
  • *
  • Posts: 38
  • FF3 User
Re: Problem loading PB DLL in VB6 IDE
« Reply #4 on: December 22, 2010, 02:16:35 PM »

How stupid can one beeeee! Dropping the trmpro.dll in the application directory of course solves the problem. Now I realize what the real problem seem to be, that my PATH Environment variable in W7-64 doesn't seem to be recognized by VB6 IDE
Logged