Home > Back-end >  Beg god for help, C builder to encapsulate the DLL cannot perform functions normally
Beg god for help, C builder to encapsulate the DLL cannot perform functions normally

Time:11-16

I made up a program function is: from D plate TXT file folder selected, and to merge files and data extraction,
Not encapsulated in the. DLL procedures before can run normally, encapsulation after finishing the following error message: access violation at address XXXXX xx. The module in a DLL, interface program there is no problem, everyone a great god can provide the help you, please teach, thank you very much

CodePudding user response:

The top a little

CodePudding user response:

Code touches something should not touch

In general, some of the code should be done in initialization or have to launch the instance has been created, you started the design environment, it is easy to go wrong

The key code

CodePudding user response:

refer to the second floor doloopcn response:
code touches something should not touch

In general, some of the code should be done in initialization or have to launch the instance has been created, you started the design environment, it is easy to go wrong

The key code

Thank you for your help, the code is as follows, I use breakpoint debugging found when performing let filename when edit1 shows an error, the trouble to help have a look at, thank you
_fastcall TForm1: : TForm1 (TComponent * Owner)
: TForm (the Owner)
{
int row;
Int lines;
Const char * importFilePath;
The FILE * fp=NULL;
OpenDialog1 - & gt; InitialDir="D: \ ";
OpenDialog1 - & gt; The Filter="text file (*.txt) | *. TXT | all files (*. *) | *. *";
SaveDialog1 - & gt; InitialDir="D: \ ";
SaveDialog1 - & gt; The Filter="text file (*.txt) | *. TXT | all files (*. *) | *. *";
SaveDialog1 - & gt; DefaultExt=". TXT ";
OpenDialog2 - & gt; InitialDir="D: \ ";
OpenDialog2 - & gt; The Filter="text file (*.txt) | *. TXT | all files (*. *) | *. *";
SaveDialog2 - & gt; FileName="SwarmUUV";
SaveDialog2 - & gt; InitialDir="D: \ ";
SaveDialog2 - & gt; The Filter="text file (*.txt) | *. TXT | all files (*. *) | *. *";
SaveDialog2 - & gt; DefaultExt=". TXT ";
}
//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Void __fastcall TForm1: : ImportFileButtonClick (TObject * Sender)
{
OpenDialog1 - & gt; The Execute ();
Form1 - & gt; Edit1 - & gt; Text=Form1 - & gt; OpenDialog1 - & gt; The FileName.
}

CodePudding user response:

OpenDialog1 - & gt; The Execute (); May return false to the if judgment,

CodePudding user response:

reference 4 floor ooolinux response:
OpenDialog1 - & gt; The Execute (); May return false to the if judgment,
ok, thank you, I tried at once

CodePudding user response:

Give a great god, thank you very much, and the problem settled, amend the Form1 pointer to this line
  • Related