Jump to content

Βοηθεια για προγραμματισμο σε C++!!!!


takissam
 Κοινοποίηση

Recommended Posts

Θα ηθελα να με βοηθησει καποιος που ασχολειται με προγραμματισμο και πιο συγκεκριμενα με C++.

 

Αυτο που θελω να κανω ειναι να "καλεσω" μια DLL της Visual Basic απο ενα προγγραμα σε C++...

 

Οποιος εχει να προτεινει κατι ας ποσταρει σας παρακαλω :)

http://www.myphone.gr/gallery/data/500/8090sunnlogoheader1.gif
Link to comment
Share on other sites

αν καλέσεις τις κατάληλες βιβλιοθήκες ( conio & stdlib ) , και μετά κανεις προσπελάσιμο το αρχείο DLL μέσω στο πρόγραμμα που θές (μέσω OPEN) μπορείς να το καλέσεις σαν απλή συνάρτηση με κενές μεταβλητες ().

Υπόθεση. Δεν το έχω δοκιμάσει, εμπειρικά τελείως

Link to comment
Share on other sites

Wirelessly posted (SIE-M55/11 Profile/MIDP-1.0 Configuration/CLDC-1.0 UP.Browser/6.1.0.7.3 (GUI) MMP/1.0)

 

THANX ADRIKO!!8A TO DOKIMASW ETSI KAI SOY LEW...

http://www.myphone.gr/gallery/data/500/8090sunnlogoheader1.gif
Link to comment
Share on other sites

Έστω ότι θες να καλέσεις την συνάρτηση MyFunction που είναι υλοποιημένη στο MyDLL.dll το οποίο βρίσκεται στο C:\ drive

 

Δημιούργησε στο κώδικά σου μια συνάρτηση η οποία θα καλεί τη συνάρτηση του dll:

 

int CallMyDLL(void)

{

/* get handle to dll */

HINSTANCE hGetProcIDDLL = LoadLibrary("C:\\MyDLL.dll");

 

/* get pointer to the function in the dll*/

FARPROC lpfnGetProcessID = GetProcAddress(HMODULE(hGetProcIDDLL), "MyFunction");

 

/* Define the Function in the DLL for reuse. This is just prototyping

the dll's function. A mock of it. Use "stdcall" for maximum compatibility.

*/

typedef int (__stdcall * pICFUNC)(char*,int);

/*Εδώ βάζεις τα ορίσματα που παίρνει η συνάρτηση που θα καλέσεις. π.χ. εδώ η συνάρτηση που καλούμε παίρνει 2 ορίσματα, ενα char * και ένα int

*/

 

pICFUNC MyFunction;

MyFunction = pICFUNC(lpfnGetProcessID);

 

/* The actual call to the function contained in the dll */

int intMyReturnVal = MyFunction("hello", 5);

 

/* Release the Dll */

FreeLibrary(hGetProcIDDLL);

 

/* The return val from the dll */

return intMyReturnVal;

}

 

Άλαξε τα ονόματα και χρησημοποίησε των κώδικα όπως είναι!!!!

Link to comment
Share on other sites

Σε ευχαριστω πολυ gpou!!!!

Θα το δοκιμασω και θα σου πω αποτελεσματα!!!

(ή τυχον προβληματα.... ¨))

http://www.myphone.gr/gallery/data/500/8090sunnlogoheader1.gif
Link to comment
Share on other sites

gpou thanx...βρηκα ακρη με αυτο που μου εδωσες!!!!

Κατι αλλο αν εχεις υποψη σου ή γενικοτερα αν ξερει κανενας....

Υπαρχουν στη C++ ετοιμες συναρτησεις που χρησιμοποιουν την σειριακη θυρα του υπολογιστη (RS232)???

Θελω για παραδειγμα να κανω την TXD 0 ή 1 ,την DTR 0 ή 1 κ.λ.π.

http://www.myphone.gr/gallery/data/500/8090sunnlogoheader1.gif
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Επισκέπτης
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Κοινοποίηση

×
×
  • Create New...