Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old February 3rd, 2006, 04:12 PM
Athono Athono is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2005
Posts: 54 Athono User rank is Corporal (100 - 500 Reputation Level)Athono User rank is Corporal (100 - 500 Reputation Level)Athono User rank is Corporal (100 - 500 Reputation Level)Athono User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 h 1 m 27 sec
Reputation Power: 4
Integer Pointer

I have a VB GUI talking to a DLL written in C++ and one of the C++ function requires a pointer to an integer. The program is called but the pointer is NULL.

(#1) How do I define an integer pointer in Visual Basic to pass to a C++ routine?

(#2) How do I make the pointer such that it is not null in Visual Basic?

Reply With Quote
  #2  
Old February 7th, 2006, 03:01 PM
Scorpions4ever Scorpions4ever is offline
Mad Rater
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 126 Scorpions4ever User rank is Corporal (100 - 500 Reputation Level)Scorpions4ever User rank is Corporal (100 - 500 Reputation Level)Scorpions4ever User rank is Corporal (100 - 500 Reputation Level)Scorpions4ever User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 11 h 31 m 44 sec
Reputation Power: 8
1. Just declare the variable as Long on the VB side (since VB Long is the same as C++ int).
2. In the function declaration, declare the variable as passed ByRef. That will pass the address of the VB variable, rather than the value.
Code:
Declare Function SomeFunc Lib "somelib" Alias _
"SomeFuncA" (ByRef hfoo As Long) As Long
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Integer Pointer


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT