Joke Collection Website - Blessing messages - Why does Easy Language dll crash when it is parasitic in the program?

Why does Easy Language dll crash when it is parasitic in the program?

Because it is reading a variable, the program will close automatically. It may be a memory reference error. First, let's see if this variable is a pointer variable or a numerical variable ... Question: What do I think? Hero, please point out the maze. Answer: Look at the DLL call command, and you can also tell me which function to call ... Follow-up: This is a development document, and I don't know what went wrong. Short message dynamic library 1 Description external interface function 1 Description. start service int _ stdcallsmsstartservice(int nport,dword baudrate = 57600,int parity = 2,int databits = 8,int stopbits = 0,int flow control = 0, Char*csca="card ") parameter: serial number of n port, such as 1, which means that the dialing rate of COM 1BaudRate is 1 5200 parity bit 2DataBits 8 stop bits 0 Flow bits. If set, the format is as follows:"+86/kloc. Second, send short message DWORD _ STDCALLSMSSENDMessage (CHAR * Msg, char * phoneno) parameters: MSG message content, if it is in Chinese, up to 70 words. Send more than 70 words in multiple short messages. If they are all in English, one is 140 characters at most. If it is greater than 140, it will be sent in multiple PhoneNo target number formats, such as "1380059 1500". The return value is meaningless. Please call function 43 to check whether the short message is successful. The structure of the received short message int _ stdcallsmsgetnextmessage (smsmessagestruct * msg) is as follows: typedefstruct _ SMS _ msg _ t _ {charmsg [256]; //SMS content charphoneno [32]; //The other party's mobile phone number Charrecetime [32]; //Receiving time} The short message read by the parameter Msg of smsmessagestruct returns 1. There is a short message 0 without 4, the status report int _ stdcallsmsreport (smsreportRuth * rept) inquires 5, and the service int_stdcallSMSStopSerice () stops 6. The last error int _ stdcallsmsgetlasterror (char * err) parameter err returns the error length of the error content of 2. Call method and use case 2. 1. 1 declaration//message structure type declaration typedefstruct _ SMS _ msg _ t _ {charmsg [256]; //SMS content charphoneno [32]; //The other party's mobile phone number Charrecetime [32]; //receiving time} SMSMessageStruct// message status report structure type declaration typedefstruct _ SMS _ report _ t _ {dword index; //SMS number: index, increasing charmsg [256] from 0; //Whether the short message content intSuccess// was sent successfully, 0 means failure, and non-zero means success CharPhoneno [32]; //Target mobile phone number} smsreportTruth///Start service function type description TypeDef int (_ stdcall * psmsstartServiceFoun) (int nport, dword baudrate = 57600, int parity = 2, int databits = 8, int stopbits = 0,int flow control = 0,char * CSCA = " card "); //Read typedef int(_ stdcall * psmsggetnextmessagefun)(smessagestruct * msg); //Send message type description typedef dword (_ stdcall * psmssendmessagefun) (char * msg, char * phoneno); //Read the status report type description TypeDefinit (_ stdcall * psmsreportfun) (smsreportRuth * REPT); //Stop the service function type description Typedefinit (_ stdcall * psmsstopsecurity) (); 2. 1.2 calling procedure hinstancehdll = loadlibrary ("mc8331at.dll"); //The dynamic library file psmssendmessagefunsmsendmessagefun must exist in the calling program directory; //function definition smssendmessagefun = (psmssendmessagefun) getprocaddress (hdll, "SMS sendmessage"); //get the function pointer If(SMSSendMessageFun! =NULL)SMSSendMessageFun ("SMS content", "mobile phone number"); //Send SMS Free Library (HDLL); //Release note 1, SMSStartService and SMSStopSerice of dynamic library 3 should appear in pairs, and resource 2 must be released before the program exits. SMSGetNextMessage needs a timer and thread to manage. If this function is not called when there are too many short messages, the new short messages will overwrite the previously unread short messages. Answer: Can you leave your contact information, which is more convenient? Question: This is the code I wrote. Please help me have a look. Version 2. Support library specifications. Assembly window assembly 1. Assembly variable ID, integer type. Subroutine _ button 1_ was clicked. Judge start (start service (2, 1 15200, 2, 8, 0, 0, "+8665433")) clock 1. Clock period = 100 button 1. Disable = true button 2. Forbidden = false. Default message box ("startup failure", 0,) clock 1. Clock period = 0 button 1. Disable = false button 2. Forbidden = true. The trial is over. Subroutine _ Button 2_ was clicked. Judge the start (stop service () = 1) message box ("Shutdown succeeded", 0,) button 65438+. ) button 1. Disable = true button 2. Disabled = false. The trial is over. Subroutine _ Button 3_ Click ID = Send Short Message. Subroutine _ Clock 1_ Periodic Event. Local variables receive messages. Local variable sending status, message report. If true (query sending status report (sending status) = 1), debug output (sending status). Return results), debug output (send status. Target mobile phone number), debugging output (sending status. Content). If true, end. Version 2. Data type SMessageStruct, message structure. Member message, text type,,,. //The other party's mobile phone number. Member receiving time, text type,,//receiving time. Data type message report, public, message status report structure. Member index, long integer. Member content, text type. Member returns result, logical type. Member's target mobile phone number and text type. Version dll command to start the service, integer type, "SMS dll. dll“,”。 Return value: 1 success, 0 failure. Parameter nPort, integer, serial number such as 1 means COM 1. Parameter baud rate, integer, dialing rate 1 15200. Parameter parity, integer and parity bit 2. Parameter data bits. Stop bit 0. Parameters flow control, integer type and flow control 0. Default values can be used for parameters Csca, text type and SMS center number. If set, the format is "+86 1380059 1500". DLL command to send short messages, integer, "SMS DLL. DLL ","SMS ". Please call function 4. Parameter message, text type, message content. Parameter PhoneNo, text type, and target number format is "1380059 1500". DLL command receives short message, integer type, "SMSDLL.dll" and "SMSGetNextMessage", and returns 654. SMSMessageStruct.DLL command query send status report, integer type, "SMSDLL. DLL”、“SMSReport”。 Parameter report, message report, address. Dll command to stop service, integer type, "SMSDLL.dll", "smsstopserice". Dll command latest error, integer type, "smsdll. Dll ","SMSGetLastError ",,returned the wrong length. Parameter err, text type, error content Answer: Where is the error? Q: I will add you as much as you want. When the clock reads the content of the received information variable, the software will automatically shut down. Answer: 283779332, please write your own question when verifying.