Solved

Link C static lib with VB?

Posted on 2001-08-01
7
360 Views
Last Modified: 2012-08-13
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
Comment
Question by:jeffs1
7 Comments
 
LVL 1

Expert Comment

by:sgovinda
Comment Utility
It is not possible!
0
 

Author Comment

by:jeffs1
Comment Utility
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
 
LVL 6

Expert Comment

by:pierrecampe
Comment Utility
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 38

Expert Comment

by:PaulHews
Comment Utility
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
 
LVL 28

Accepted Solution

by:
AzraSound earned 100 total points
Comment Utility
0
 
LVL 1

Expert Comment

by:Un1
Comment Utility
0
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
jeffs1,
Any updates?  You also have several other open questions that need tending to...
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

772 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

10 Experts available now in Live!

Get 1:1 Help Now