Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 371
  • Last Modified:

Link C static lib with VB?

I have a static .lib or .obj file that was written in Visual C that I need to link into a VB application... can anyone tell me if this is possible and if so, how it is done?  Building the lib as a DLL is not an option... it must be statically linked into the VB app...

Jeff
0
jeffs1
Asked:
jeffs1
1 Solution
 
sgovindaCommented:
It is not possible!
0
 
jeffs1Author Commented:
Why? I am not a VB programmer... but does VB not produce a compiled, machine code object file?  Does it not link these with the standard link.exe?  Then why can it not link in a Visual C compiled obj file?

Jeff
0
 
pierrecampeCommented:
I can not tell you how to do it
but i think it is possible
here's what i found while playing with vb
when vb compiles a program the C2 compiler runs as a proces
thats probably the same C2 vc uses
vb compiles all its modules to .obj files and deletes them when finished
there is 1 .obj file that comes with vb 'vbaexe6.obj'
so i think its save to assume that file is needed by the linker
when i ran the following 'program' while vb was compiling it prevented vb from deleting the .obj files
Private Sub Command1_Click()
    On Error Resume Next
    Do
       Open "ProjectLink.obj" For Input As #1
       DoEvents
    Loop While Err
    Close
End Sub
Private Sub Command2_Click()
    End
End Sub
however when i tried to link the .obj files and vbaexe6.obj the linker came with an error 'no entry point'
and there i was stuck
maybe you can solve that
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!

 
PaulHewsCommented:
Yeah, I saw this in a VBPJ article once.  I think they replaced the linker with a custom linker.  It required some very fancy footwork if I remember correctly.  (Don't remember the article, but maybe it will remind someone else--someone with a mind.)
0
 
AzraSoundCommented:
0
 
Un1Commented:
0
 
AzraSoundCommented:
jeffs1,
Any updates?  You also have several other open questions that need tending to...
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now