|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Looking for VC6 newsgroupI am normally using VB6 but this time I need to create a DLL from an
..h-file and I guess I can only do this in VC6/C++. Because of this I would like to know what the current (if there is still one at all) VC6 newsgroup is. I don't want to use VC.NET. Thanks in advance. Have a nice day! Karl On 9/2/2010 3:33 AM, Abhishek wrote:
reader80.eternal-september.org has these c++ groups (and a few others): alt.ocmp.lang.learn.c-c++ comp.lang.c++ comp.lang.c++.leda comp.lang.c++.misc comp.lang.c++.moderated comp.std.c++ microsoft.public.cn.vc++ sybase.public.watcom_c_c++.general On 02/09/2010 10:20, Karl Steffen wrote:
> I am normally using VB6 but this time I need to create a DLL from an I tend to use comp.os.ms-windows.programmer.win32.> .h-file and I guess I can only do this in VC6/C++. Because of this I > would like to know what the current (if there is still one at all) VC6 > newsgroup is. I don't want to use VC.NET. Thanks in advance. Have a nice > day! Karl The microsoft.public groups I used to watch have now been shutdown (on the original servers) -- Dee Earley (dee.ear***@icode.co.uk) i-Catcher Development Team iCode Systems (Replies direct to my email address will be ignored. Please reply to the group.) On Thu, 02 Sep 2010 11:20:10 +0200, Karl Steffen <k.stef***@gmx.de> wrote:
¤ I am normally using VB6 but this time I need to create a DLL from an ¤ .h-file and I guess I can only do this in VC6/C++. Because of this I ¤ would like to know what the current (if there is still one at all) VC6 ¤ newsgroup is. I don't want to use VC.NET. Thanks in advance. Have a nice ¤ day! Karl You can find the MSDN forums at the below link: http://social.msdn.microsoft.com/Forums/en-US/category/visualc Paul ~~~~ Microsoft MVP (Visual Basic) On Thu, 02 Sep 2010 11:20:10 +0200, Karl Steffen <k.stef***@gmx.de>
wrote: >I am normally using VB6 but this time I need to create a DLL from an As you can not "create a DLL from an .h-file" no matter what language>.h-file and I guess I can only do this in VC6/C++. Because of this I >would like to know what the current (if there is still one at all) VC6 >newsgroup is. I don't want to use VC.NET. Thanks in advance. Have a nice >day! Karl or platform you use, I'm wondering if you mean instead that you need to employ a DLL (written in C/C++) in a VB project, and all you have is the header file? If this is the case you can convert the header file to a Type Library and include a reference to it in your VB Project. If it is by chance a platform or language specific DLL then you can also wrap the DLL as an ActiveX component and access it that way. But we would need to know more about the DLL. So what it is you are really trying to do? -ralph Yes, Ralph, that is exactely the problem.
I wanted to use a third party library that was written in C++. They provided an h-file and a lib-file, but no dll. I thought I had to make a dll file myself by making a wrapping dll, written in C++ which resembles the methods and properties like an ActiveX exe. Since it's now already known that I don't really have a clue about it, I can admit it. If I could turn the header file into a tlb, it would help me indeed. Could you give me a very short introduction how this would be done? Thank you very much in advance. Karl Steffen Am 02.09.2010 15:56, schrieb ralph: Show quoteHide quote > On Thu, 02 Sep 2010 11:20:10 +0200, Karl Steffen<k.stef***@gmx.de> > wrote: > >> I am normally using VB6 but this time I need to create a DLL from an >> .h-file and I guess I can only do this in VC6/C++. Because of this I >> would like to know what the current (if there is still one at all) VC6 >> newsgroup is. I don't want to use VC.NET. Thanks in advance. Have a nice >> day! Karl > > As you can not "create a DLL from an .h-file" no matter what language > or platform you use, I'm wondering if you mean instead that you need > to employ a DLL (written in C/C++) in a VB project, and all you have > is the header file? > > If this is the case you can convert the header file to a Type Library > and include a reference to it in your VB Project. > > If it is by chance a platform or language specific DLL then you can > also wrap the DLL as an ActiveX component and access it that way. But > we would need to know more about the DLL. > > So what it is you are really trying to do? > > -ralph On Fri, 03 Sep 2010 06:28:04 +0200, Karl Steffen <k.stef***@gmx.de>
wrote: >Yes, Ralph, that is exactely the problem. First, need to make sure of what we are talking about here.>I wanted to use a third party library that was written in C++. >They provided an h-file and a lib-file, but no dll. >I thought I had to make a dll file myself by making a wrapping dll, >written in C++ which resembles the methods and properties like an >ActiveX exe. >Since it's now already known that I don't really have a clue about it, I >can admit it. > >If I could turn the header file into a tlb, it would help me indeed. >Could you give me a very short introduction how this would be done? > You said "They provided an h-file and a lib-file, but no dll". If this is the case then it is a static link library and NOT a dll, and unfortunately can not be used by VB. (*well maybe ...). But you said it was a DLL? So where is it? Does it perhaps have a different extension? Quick definitions: (pedantic I know... but want to make sure we are on the same page.) ..h files - headers contain declarations of interfaces, functions, structs, constants, etc. They are meant to be included with C/C++ source code at compile time. ..lib files - Come in two basic flavors. They either declare the binary interface to a DLL, or contain binary code to be statically linked with a program at compile time. The former if supplied with a DLL can be ignore for VB purposes. ..dll files - dynamically linked library file. Essentially the same as a compiled .lib except it is linked at runtime. These can be used by VB. Second, since we really don't know for sure if you have a DLL or not the rest of this may be worthless. <g> There is lot's of information available on the web on type libraries. Here are a few places to get you started. IDL For VB Tutorial <you have to register to read, but it is free> http://www.devx.com/vb2themax/Article/19830 Bruce McKinney's Win32 API Type Library http://vb.mvps.org/hardweb/mckinney2a.htm <download the WinTlbU.zip file> Some general notes: 1. A type library is nothing more that a compiled "header file". So the steps are these: a) Convert the declarations in a header file to IDL (Interface Description Language) b) Compile the IDL source into a Type Library That is it. 2. The most common use for employing type libraries in VB is to skip using Declare directives for WinApi libraries. I gave a link to McKinney's type library for the WinAPI. The advantages to downloading and examining this are ... a) You get all the IDL source You can look at the C declarations in the MSDN and then compare to how they look when converted to IDL. b) you get a compiler and a general batch file for compiling your own. c) Or put another way - you can steal like crazy. <g> 3. IDL on first look is daunting. And it can be quite complex for some situations, but in general and for your needs it quite straight-forward. If you get stuck - post here. Lots of ppl speak IDL here. <g> Third, which is something I really feel stupid about not mentioning in my first post. If it is a DLL - you can just turn the header file into Declare directives. As well as declare any structs and constants, etc. I always automatically turn to using a Type Library, but if this is a one-off situation, the library isn't that large or complex, and you're not in the mood to learn a bunch of stuff <g>. Then Declare directives is the way to go. -ralph "Karl Steffen" <k.stef***@gmx.de> wrote in message If you don't have experience of using VC, then it's better let someone else news:elKfXCySLHA.620@TK2MSFTNGP06.phx.gbl... > Yes, Ralph, that is exactely the problem. > I wanted to use a third party library that was written in C++. > They provided an h-file and a lib-file, but no dll. > I thought I had to make a dll file myself by making a wrapping dll, > written in C++ which resembles the methods and properties like an ActiveX > exe. > Since it's now already known that I don't really have a clue about it, I > can admit it. > > If I could turn the header file into a tlb, it would help me indeed. > Could you give me a very short introduction how this would be done? do it, or ask the author to make a DLL version. Basically, you need to create a ".CPP" file with DllMain() function, then write wrapper functions. The new project wizard can be used to make a skeleton DLL, and then you add the .LIB file in project settings under Link tab. Your C file would look like this: #include "mydll.h" #include <Windows.h> BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { // Some code here } int STDCALL vbGetInfo(int Index) { return GetInfo(Index); } In the above, I am assuming that the DLL has a function called GetInfo(). So vbGetInfo() is your version of the function. You will need to add a ".DEF" file to export the functions in a way that VB can use them. The VC wizard would use "dllexport" in the function declaration, but this is not suitable for VB. You have to add a ".DEF" file to export the functions properly for VB to use them. See ".DEF files" in MSDN. Here is what a DEF file looks like, which is very simple: LIBRARY MyDLL DESCRIPTION 'My DLL' EXPORTS vbGetInfo vbSetInfo Some useful links: http://www.learncpp.com/ http://www.cplusplus.com/
Show quote
Hide quote
On Fri, 3 Sep 2010 03:00:39 -0400, "Nobody" <nob***@nobody.com> wrote: Here's another link>"Karl Steffen" <k.stef***@gmx.de> wrote in message >news:elKfXCySLHA.620@TK2MSFTNGP06.phx.gbl... >> Yes, Ralph, that is exactely the problem. >> I wanted to use a third party library that was written in C++. >> They provided an h-file and a lib-file, but no dll. >> I thought I had to make a dll file myself by making a wrapping dll, >> written in C++ which resembles the methods and properties like an ActiveX >> exe. >> Since it's now already known that I don't really have a clue about it, I >> can admit it. >> >> If I could turn the header file into a tlb, it would help me indeed. >> Could you give me a very short introduction how this would be done? > >If you don't have experience of using VC, then it's better let someone else >do it, or ask the author to make a DLL version. Basically, you need to >create a ".CPP" file with DllMain() function, then write wrapper functions. >The new project wizard can be used to make a skeleton DLL, and then you add >the .LIB file in project settings under Link tab. Your C file would look >like this: > How To Make C DLL More Accessible to VB with a Type Library http://support.microsoft.com/kb/189133 But we better be careful. May get flamed for trolling VC. <g> -ralph Karl Steffen <k.stef***@gmx.de> schrieb im Beitrag
<OIQ56AoSLHA.5***@TK2MSFTNGP02.phx.gbl>... > I am normally using VB6 but this time I need to create a DLL from an Since you seem to be from Germany:> .h-file and I guess I can only do this in VC6/C++. Because of this I > would like to know what the current (if there is still one at all) VC6 > newsgroup is. I don't want to use VC.NET. Thanks in advance. Have a nice > day! Karl de.comp.lang.misc de.comp.os.ms-windows.programmer (Some people from microsoft.public.de.vc are to be found there...) -- Thorsten Albers albers (a) uni-freiburg.de
Error 481 Invalid picture
Global class and WithEvents Distibution of VB6 program Lockup Continues Why doesn't this work (sendmessage) Radio Button Bug? Showing/Using Sort arrows on vb6 listviews? Closing Grouped instances in the taskbar Componenet not installed correctly by PDW Error 5: ERROR_ACCESS_DENIED when accessing registry in Windows 7 |
|||||||||||||||||||||||