DLL DllEntryPoint using data modules

I have the following code

  DllProc: Pointer; { Called whenever DLL entry point is called }
    if DllProc = nil then begin
      DllProc := @DLLEntryPoint;

  procedure DLLEntryPoint(Reason: DWORD);
    case Reason of
        //MessageBox(DLLHandle, 'Process Attach', 'Info', mb_Ok);
        //MessageBox(DLLHandle, 'Process Detach', 'Info', mb_Ok);
    end;                                          // case

function LicenseLoad: boolean;
 st : TStream;
  dmData := TdmData.Create(nil); <<<< STOPS HERE
  GenerateMachineId; // generate a machine id
  st := dmData.tblLicense.CreateBlobStream(dmData.tblLicense.FieldByName('Key'),bmRead);
  result := LoadLicenseStream(st);

The only problem is that when you try this it stops in creating the tmdata object. This is when using LoadLibrary to load the dll, if you call the code directly then it works

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

do you have any code in the datamodules constructor
or any "Active" components
debug the datamodules constructor to see what happens

also what delphi version u using
6 and above descend the TDataModule from TComponent so this shouldn't be a problem
jeffborgAuthor Commented:
Yes there is code in the datamodule on the ModuleCreate event. But it dosen't get there. also it's delphi 7

Also the code dosen't even get there. It just stops at the line mentioned.
do you have any datasets with Active set to true or anything similar ?
Amazon Web Services

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

jeffborgAuthor Commented:
The datasets get set to active via my code which initializes the datamodule.

This all worked fine before I started to Call the function listed above from the dllentrypoint.
weird ... I'll create a test dll to check this out
maybe vcl is fuxored :)

  DllProc: Pointer; { Called whenever DLL entry point is called }

why did you declare it ? it's a global var in SysInit :)
just noticed this
anyway this shouldn't have any effect on the processattach entry
only the processdetach would never be called in your code

I have no problems with my datamodule (using a ClientDataSet)

some other component on your datamodule must be causing the problem

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
is there a new grading policy ? the grade C doesn't really smell that good .. but I understand why the C in such cases
in the future I might object to being awarded the points with such a grade :)
ooooh .. sorry kacor, thought it was a forced accept .. my bad :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.