Solved

Connecting an OCX to a Windows 95 C Program

Posted on 1998-11-26
7
242 Views
Last Modified: 2010-04-15
One of our customers wants to connect our OCX'es to his existing C Program.
I'd like to know if that is possible and what he has to do
0
Comment
Question by:Norbert
[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
7 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 1254668
The easiest way i could imagine is writing a wrapper DLL that encapsulates e.g. the COleDispatchDriver wrapper classes (so to say 'wraps the wrappers' ;-) and exports C-style functions that make the functionality accessible (e.g. converts OLE events into windows messages and so on)...
0
 
LVL 1

Expert Comment

by:semuel
ID: 1254669
Hello there.

you forgot to mention the enviroment were he wrote his C program.
if it's an ANSI-C program, forget it. ansi-C does not support dlls and thing like that.
if he's using any other enviroment... well, it's depend on the enviroment.

Semuel.
0
 
LVL 86

Expert Comment

by:jkr
ID: 1254670
semuel - do you think it's a good idea to lock the question without supplying a really useful answer???
0
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 
LVL 3

Author Comment

by:Norbert
ID: 1254671
Sorry for the late respose.
I had a accident last thurstday when I leaved the company after I had posted the question and I am back to the office now the first time.

Semuel:
Well if we talk about using of already existing OCX'es I thought
it is clear that it must be a MS Windows enviroment
but to be clear it is Windows 95/98.
Our custom has simple a program written for windows and he like our ocx'es so he wants to use it

JKR:
If I understand you right you recommend to create a C- Style DLL
that works as interface between the OCX'es and the C Program.
I think that should work but it is a hardcoded solution and because each property and event have to be known by the DLL the flexibility of the OCX linking will be lost

0
 
LVL 86

Expert Comment

by:jkr
ID: 1254672
Well, regarding the nature of an IDispatch for example, it should be possible to also do some parametrization from the outsinde...
0
 
LVL 11

Accepted Solution

by:
mikeblas earned 100 total points
ID: 1254674
The suggestion of using COleDispatchDriver is actually dependent on static information being known about the type library. Involiving MFC in this situation seems inappropriate because you're not going to get much useful stuff from MFC in the DLL you're writing.

You can write a C-based application that handles the interfaces OLE Controls need to be contained and displayed. That's your only realistic chance of getting this work done.

The only code I know of to do this kind of containment is in the 2nd edition of Kraig Brocksmidt's book. (And now that I'm thinking of it, I'm wondering if my memory is foggy--he might have written the code with C++.)

To couple OLE Controls with C-style code, I'm afraid your only choice is going to be to roll up your sleeves and write the solution yourself.

B ekiM
0
 
LVL 3

Author Comment

by:Norbert
ID: 1254675
Now back from vacation.
Its a hard work to do all again
0

Featured Post

Industry Leaders: 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

Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
Suggested Courses

615 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