Solved

how to include c header file in vb

Posted on 2001-06-12
6
374 Views
Last Modified: 2013-11-18
How to include c header file in vb. normally in c written as follows:
#include "vbconst.h"

is there any way to write the above include statement in vb module.
0
Comment
Question by:azsoft
  • 2
  • 2
  • 2
6 Comments
 
LVL 3

Expert Comment

by:sombell
ID: 6180363
You cant do what youre asking for for two reasons:

1) There is no "include" capability in VB. you would have to cut and paste the text into the VB form.

2) The syntax of C header files is totally different to the syntax of VB, so even if you cut and paste the whole header file, it will cause compilation errors in VB. You need to edit the header file to turn it into VB syntax.

If you want to include common declarations in your VB program (API functions & constants) then I reccomend you get yourself a copy of the VB Type Library. To use this you include it as a Reference in the project, then all the declarations are available to you in your program.

you can get the VB Type Library from :

http://www.themandelbrotset.com/Technical/typelib.asp

unfortunately you will still find there are some declarations not in this (though not that many). You will have to do these "by hand" still. But at least the majority are done for you.

Hope this helps.

Sombell
0
 
LVL 15

Accepted Solution

by:
ameba earned 50 total points
ID: 6180447
You can write this statement:
#Const include = "vbconst.h"
but it won't include a file. :-)
To include a file, press Ctrl+D, or use menu Project, Add Module, or drag file from Windows Explorer to VB Project Explorer.
0
 
LVL 38

Expert Comment

by:PaulHews
ID: 6181615
>How to include c header file in vb

If it is a c header, it will be meaningless in VB unless you rewrite it in VB syntax.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 38

Expert Comment

by:PaulHews
ID: 6181625
But that has already been said (and I haven't had coffee yet this morning.  *yawn* scritch scritch.)
0
 
LVL 15

Expert Comment

by:ameba
ID: 6182094
Yes, that will teach me to choose where to put my comments.
0
 
LVL 3

Expert Comment

by:sombell
ID: 6182221
grief !
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now