pombinhu Posted May 8, 2009 at 09:45 AM Report #262290 Posted May 8, 2009 at 09:45 AM olá!!! Estou a fazer um programa em C, para somar duas variáveis. mas não consigo aceder á função que soma as variáveis, que está numa dll. a dll foi desenvolvida em VB.NET e é a seguinte: Public Class Class1 Function addiction(ByVal x As Integer, ByVal y As Integer) As Integer Dim result As Integer result = x + y Return result End Function End Class o código em C é este: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <windows.h> typedef int (*Soma_ptr)(); Soma_ptr somar=NULL; int main(int argc, char *argv[]) { int num; HMODULE dll = LoadLibrary("SomaTeste.dll"); if(dll) somar = (Soma_ptr) GetProcAddress(dll, "addiction"); num = somar(1,5); printf("O Resultado e': %d\n",num); system("PAUSE"); return 0; } Alguem me pode ajudar...
TheDark Posted May 8, 2009 at 10:02 AM Report #262294 Posted May 8, 2009 at 10:02 AM Qual é o problema, exactamente? Desaparecido.
pombinhu Posted May 8, 2009 at 10:24 AM Author Report #262300 Posted May 8, 2009 at 10:24 AM Quando compilo o projecto em C aparece uma janela com um relatório de erros.
TheDark Posted May 8, 2009 at 07:09 PM Report #262467 Posted May 8, 2009 at 07:09 PM E já fizeste debug para ver de onde vem essa janela de erros? Desaparecido.
pombinhu Posted May 15, 2009 at 08:44 AM Author Report #264296 Posted May 15, 2009 at 08:44 AM sim logo quando inicio o debug aparece a janela de erros.
TheDark Posted May 15, 2009 at 09:50 AM Report #264315 Posted May 15, 2009 at 09:50 AM Em que instrução? Desaparecido.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now