Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

how to include c header file in vb

Posted on 2001-06-12
6
Medium Priority
?
384 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 150 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

722 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