|
-
Mar 27th, 2003, 09:14 AM
#1
Thread Starter
Junior Member
Arguments to DLL functions
Hi!
I'm having some problem with a function in a DLL that I'm writing.
I need to recieve a System.Drawing.Graphics object as an argument to this function...
but visual studio keeps saying "Type 'System.Drawing.Graphics' is not defined"
It doesn't work to import System.Drawing either
This is the code I have
Code:
Public Shared Function drawCircle(ByVal x1%, ByVal gr As System.Drawing.Graphics) As System.Drawing.Graphics
'Implementation
End Function
Why doesn't it work?
-
Mar 27th, 2003, 10:57 AM
#2
PowerPoster
ByVal x1%
What does that mean?
-
Mar 27th, 2003, 11:11 AM
#3
New Member
ByVal x1%
% is equivilant to typing 'as interger'
so you end up with a interger called x1
ByVal means that x1's value is passed to the function instead of a reference to x1
-
Mar 27th, 2003, 11:15 AM
#4
I dont think % works like that in .NET.
-
Mar 27th, 2003, 11:15 AM
#5
To start with:
You need a reference to system.drawing.dll
But if I am correct, you cannot create a system.drawing.graphics object (or pass it byval). The graphics object can not be seperated from the device context that provided it. If lets say a picturebox provides a graphics object, you cannot use it seperate from the picturebox. Without the device context, the graphics object is useless. Are you sure you need it byval? Byref should be no problem.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|