ariel_au
April 16th, 2001, 11:20 AM
i created a .DLL named (dlldemo.dll) using MS visual C++
below is my DLL function in C++.
#include <windows.h>
void __stdcall Multiply(int Cheight, int Cwidth, int Cproduct)
{
Cproduct = Cheight * Cwidth;
return;
}
well, what my DLL does is that it computes the Cproduct from input Cheight and Cwidth of a form.
below in my VB form that calls the .DLL
option Explicit
private Declare Sub Multiply Lib "C:\dlldemo.dll" (Cheight as Integer, Cwidth as Integer, Cproduct as Integer)
'-------------------------------------------------------------------
'In my form, upon OK button is clicked....
private Sub CmdOk_Click()
Dim Cheight as Integer, Cwidth as Integer, Cproduct as Integer
Cheight = Val(txtHeight.Text) 'input height from textbox
Cwidth = Val(txtWidth.Text) 'input width from textbox
Multiply Cheight, Cwidth, Cproduct ' call DLL
If Cproduct Mod 2 <> 0 then 'return(Cproduct) the computed value in .DLL to here...
'POP up a msgbox if the computed Cproduct is an odd num...
MsgBox "The values generate an odd number of icons." & vbCrLf & _
"Change Width and/or Height so that their product " & vbCrLf & _
"is an even number.", vbInformation, "Change Width and/or Height"
Exit Sub
:
:
:
well, i my problem is that my msgBox does not pop-up if the Cproduct is an odd number.
i think that something is wrong in my .DLL or maybe the way i call my DLL is incorrect.. anyone noes where is the problem?? pls reply, thank you.
below is my DLL function in C++.
#include <windows.h>
void __stdcall Multiply(int Cheight, int Cwidth, int Cproduct)
{
Cproduct = Cheight * Cwidth;
return;
}
well, what my DLL does is that it computes the Cproduct from input Cheight and Cwidth of a form.
below in my VB form that calls the .DLL
option Explicit
private Declare Sub Multiply Lib "C:\dlldemo.dll" (Cheight as Integer, Cwidth as Integer, Cproduct as Integer)
'-------------------------------------------------------------------
'In my form, upon OK button is clicked....
private Sub CmdOk_Click()
Dim Cheight as Integer, Cwidth as Integer, Cproduct as Integer
Cheight = Val(txtHeight.Text) 'input height from textbox
Cwidth = Val(txtWidth.Text) 'input width from textbox
Multiply Cheight, Cwidth, Cproduct ' call DLL
If Cproduct Mod 2 <> 0 then 'return(Cproduct) the computed value in .DLL to here...
'POP up a msgbox if the computed Cproduct is an odd num...
MsgBox "The values generate an odd number of icons." & vbCrLf & _
"Change Width and/or Height so that their product " & vbCrLf & _
"is an even number.", vbInformation, "Change Width and/or Height"
Exit Sub
:
:
:
well, i my problem is that my msgBox does not pop-up if the Cproduct is an odd number.
i think that something is wrong in my .DLL or maybe the way i call my DLL is incorrect.. anyone noes where is the problem?? pls reply, thank you.