Home > Back-end > Urgent ask for help, C builder to encapsulate DLL cannot perform functions normally
Urgent ask for help, C builder to encapsulate DLL cannot perform functions normally
Time:09-17
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, you great god can provide the help you seek counsel, grateful After the discovery of the error I step through pop-up place in edit1 display file name on this statement, the code is as follows: _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:
error message and not the normal procedures before packaging
CodePudding user response:
In the context of the code, there should be no problem, although OpenDialog1 - & gt; The Execute (); Form1 - & gt; Edit1 - & gt; Text=Form1 - & gt; OpenDialog1 - & gt; The FileName. Logic is a little problem, it should be If (OpenDialog1 - & gt; The Execute ()) Form1 - & gt; Edit1 - & gt; Text=Form1 - & gt; OpenDialog1 - & gt; The FileName. But will not lead to abnormal