|
Create an ATL object such as MyDialog with the Wizard.
Add a method to the interface such as ShowDialog
Inside the ShowDialog function, call your dialog
m_MyDialog.DoModal()
Declare an instance of m_MyDialog in the class definition.
hope this helps,
Michael
|
|
|
|
|
Sorry, but it's clear you don't know enough about COM in order to write a COM dll. Adding ATL support allows you to write ATL code, it does not link everything up magically for your dll to become a COM object.
IDispatch is an interface derived from IUnknown, which is the base interface for all COM objects. IDispatch is the interface for automation objects ( those visible to VB, etc ). IDL is the language use to define interfaces ( that's what the I stands for ), and you can't convert MFC to IDL, they are different beasts. Again, you're in real trouble if you need to achieve this in a hurry, you cleary do not have the skills you need.
I recommend you buy some books on ATL. I don't know that much about it myself, but you clearly are hoping for a magic bullet, and you aren't going to find it in the solution you're looking for, sorry.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
What you need in your dll are COM interfaces. These will allow you to access the controls methods and properties from other applications.
The best way to do this using MFC is to start with a different project type, MFC ActiveX control. Otherwise use Class Wizard to add automation interfaces. Go to the Automation tab. Choose Add Class, create your class and click the Automation radio button. This will add, not only a new class, but an interface. When you look in Class View, you will see CMyNewClass and IMyNewClass.
Thanks for the help,
Bill
|
|
|
|
|
Can someone tell me how to get CListCtrl::SetBkImage() to 'actually' work??? I've been messing with it for quite a few hours and just can't seem to get it to work. TIA
Kevin Power, Jr.
|
|
|
|
|
|
Can someone tell me how to get CListCtrl::SetBkImage() to 'actually' work??? I've been messing with it for quite a few hours and just can't seem to get it to work. TIA
Kevin Power, Jr.
|
|
|
|
|
Hi everyone,
I was wondering if anyone could tell me how i would go about implementing a Napster / Scour Exchange like interface for my app.
The app isnt a file sharing program, i just need to know the best way to have multiple panes of information that can be activated using a button. I think napster used some sort of embedded property sheets or something.
The app needs to be resizable. ie look like a normal SDI/MDI prog and each view will be a listview or a html view or something else.
What i'm really aiming for is something like the Scour Exchange client which had an Outlook like toolbar down the side and each icon in the toolbar would activate a different view on the right hand pane.
Thanks for any help!
Ash
|
|
|
|
|
Napster actually uses a tab contol, but with the styles set so that the control shows buttons instead of tabs.
--Mike--
http://home.inreach.com/mdunn/
"The Earth is doomed." -- Rupert Giles
your with and
|
|
|
|
|
It is quite shame for me but here is my problem. I had been using SDK for some time. However, I am still quite confuse on what does SDK(software development kit) stand for. ie:
1. what library package should belongs to SDK?
2. does windows.h and stdio.h belongs to SDK?
thanks a lot.
|
|
|
|
|
No wonder you're confused - you've confused me...
SDK stands for software development kit. Lots of people release SDK's, for example Flash has one.
You're talking about the Windows SDK I presume - how do you mean belongs to the SDK ? Everything the SDK installs 'belongs' to it. Do you mean .lib files ? I'm lost.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
I am using microsoft visual c++. I am confusing since from the documentation in msdn cd, they place the function like MessageBox() under SDK catagory while printf() under another category.
|
|
|
|
|
Ah... Unlike C# or Visual Basic, C++ is a language that exists on multiple platforms. It was written by Bjarne Stroustrup, and if you program C++, you should own his books.
printf is part of the C++ standard, and so is applicable to all implimentations of C++. MessageBox() is specific to Windows - a system running C++ code needn't even have a display, let alone a GUI, and only output of text is supported in the standard. So the differentiation you notice is between M$ specific code and code generic to the underlying language.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Actually printf() is part of the C standard RTL.
|
|
|
|
|
Quite possibly
I've never done any straight C, so I really have only vague ideas what is C and what is C++.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
I've never done any straight...
There is a joke in there somewhere...
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|
|
how can i add a version number to the CDocument class?
ZHANGYIFEI
|
|
|
|
|
Do you want to add to CDocument, or your CDocument derived class ? Why ?
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
i want to add to CDocument not the derived class!
I WANT DO THIS !THANK YOU!
ZHANGYIFEI
|
|
|
|
|
Sorry, you can't. MFC is in a dll and is used by all sorts of other programs. You can't change the implimentation to suit you, you'll need to derive from it.
Maybe if you said what you're trying to do, I could offer more of a suggestion.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Hi,
In my project,I have to make a custom software that should be able to interface with other standard s/w in the market for some calculations.How can I do this because I donot know the functions used in that s/w?
I may have to interface with Mathlab.
Please help me.If the solution is lengthy ,would you mind mailing to jumvmk@yahoo.com.
Thanx.
|
|
|
|
|
How/why do you want to interface with other software ? What software ? Some software, like Office, exposes interfaces through COM, others may not be written to allow your participation and will therefore only be possibly on a limited basis, and based on your code invading the progam involved.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
The solution depends on the software you need to use. In case of Matlab, see the Matlab external interface documentation, under the headings "Calling Matlab from C and Fortran programs" and "ActiveX and DDE support".
|
|
|
|
|
I have a class which handles serial port communication.
It works fine on windows 95 and windows 98 but it fails on
Windows 2000.
Actually there is a worker thread which reads data from serial port and sends the message to the main thread when
data is available.
Under windows 2000 ReadFile and WriteFile
functions does not return and program stucks up there.
|
|
|
|
|
Well, without more information I can't tell you what is wrong, but I do know ReadFile and WriteFile work just fine on W2k without hanging the program.
Are you using SetCommTimeouts?
Are you using Overlapped reads and writes?
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|
|
Yes, I am using SetCommTimeouts, but overlapped I/O is not used.
Program is vary simple. Port is opened using CreateFile as follows
m_hComm = CreateFile(sPort, GENERIC_READ |GENERIC_WRITE, 0, NULL, OPEN_EXISTING, bOverlapped ? FILE_FLAG_OVERLAPPED: 0, NULL);
then comm timeouts are set as follows
memset(&m_commtimeouts, 0, sizeof(COMMTIMEOUTS));
m_commtimeouts.ReadIntervalTimeout += 2;
if(parity != NoParity)
m_commtimeouts.ReadIntervalTimeout++;
if(stopbits != OneStopBit)
m_commtimeouts.ReadIntervalTimeout++;
m_commtimeouts.ReadIntervalTimeout++;
m_commtimeouts.ReadIntervalTimeout += byDataBits;
m_commtimeouts.ReadIntervalTimeout *=
(int)ceil(1.0 / (double)dwBaud);
SetCommTimeout(m_hComm, &m_commtimeouts);
|
|
|
|