|
I found the solution thanks you the any way
el hombre arriesga su vida cada vez que elige y eso es lo que lo hace libre
|
|
|
|
|
I try to make an active X calling an other active X, but I dont know how to do to make the active X I'm calling to be visible.
I don't know if I explain it as clearly as I should, but who can help me?
Thank you
|
|
|
|
|
Are you using MFC ? Well... anyway.. he activex will have and hWnd handle, just call the ShowWindow API and the control should display. If you're using MFC, you can use a method with the same name... that does the same thing.
Mauricio Ritter - Brazil
Sonorking now: 100.13560 MRitter
Life is a mixture of painful separations from your loved ones and joyful reunions, without those two we'd just be animals I guess. The more painful the separation, that much more wonderful will be the reunion - Nish
"Th@ langwagje is screwed! It has if's but no end if's!! Stupid php cant even do butuns on forms! VISHAUL BASICS ARE THE FUTSHURE!" - Simon Walton
|
|
|
|
|
Do I Have to create a CDialog to insert my active X into?
|
|
|
|
|
No.. you don't need to. Whatever method you use, the activex will always have an hWnd handle. Can you post the method you're using to create it ?
Mauricio Ritter - Brazil
Sonorking now: 100.13560 MRitter
Life is a mixture of painful separations from your loved ones and joyful reunions, without those two we'd just be animals I guess. The more painful the separation, that much more wonderful will be the reunion - Nish
"Th@ langwagje is screwed! It has if's but no end if's!! Stupid php cant even do butuns on forms! VISHAUL BASICS ARE THE FUTSHURE!" - Simon Walton
|
|
|
|
|
No, I haven't any hWnd...
My project is to create an Active X. So I've created this with Visual C++.
Then I want to insert in this project my other control Active X so I go to Project, Add to Project, Components and controls and I choose the component I want.
I've added methods to my project so I can call them from a tester...
On the call of one of this methods, i want to make the component I've inserted to be visible (it's a map)... How can I draw it?
I only have the about box and the property dialog in my project at the moment...
Thanks
dvlpt
|
|
|
|
|
I have created an MFC project through AppWizard which supports Active Documents. If I create a new document and insert an existing Word file, all looks fine. However, when I come to print preview, the preview window opens, but the document is actually printed to the printer.
I asked a while ago and no-one had any ideas of how to make it work, but I've come up with a few possibilities, and wondered if anyone might be able to help.
First possibility is to change the parameters to IPrint::Print() so that it uses the preview screen DC instead of the printer - anyone know how this can be done?
The second option is printing to a file, and then viewing the file. Any ideas on how I can view a "Print to File" file on screen?
Thanks in advance!
|
|
|
|
|
Can anyone suggest a good sample app that demonstrates multi-threaded graphics using VC++ and MFC? Trying to get a seperate thread working to handle dialog graphics animation. Thanks
|
|
|
|
|
find the "MTGDI" sample in the MSDN. it's the classic multi-threading sample: each thread controls a bouncing ball.
-c
|
|
|
|
|
Thanks, I forgot all about that one. I'll check it out.
|
|
|
|
|
How can I implement a class function, which can be run in separate thread
Example
class AudioIn
{
public:
AudioIn();
virtual ~AudioIn();
void StartProc();
HANDLE Thread;
DWORD m_ThreadID;
HANDLE hEvent;
};
AudioIn::AudioIn()
{
hEvent = CreateEvent(NULL,TRUE,FALSE,NULL);
Thread = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)AudioIn::StartProc,NULL,0,&m_ThreadID);
}
Is it possible?
I'm creating console application in VC++.
Sorry for stupid question.
Tomaz
|
|
|
|
|
Yes. One your example, declare StartProc as a static public member function.
Kuphryn
|
|
|
|
|
How can I get few parameters into static class function?
Should I declare a structure
Thread = CreateThread(NULL,0,AudioIn::StartProc,declared-structure,0,&m_ThreadID);
or is there a simple way?
Thank you
Tomaz
|
|
|
|
|
You have to declare a structure and pass a pointer to it. There are some common problems regarding who owns this structure. Consider the following:
void foo()
{
data d;
CreateThread(...,&d,...)
} This seems OK and will probably work some times until it suddenly stops to do it. The reason is that, when the thread starts executing and access d , it is perfectly normal that foo has already exited, and d is no longer valid. So, you have to dynamically allocate the data:
void foo()
{
data* d=new data;
CreateThread(...,d,...)
} Now the problem is who deletes d ? The most reasonable choice is to let the thread delete the data:
MyThread(LPVOID arg)
{
data * d=(data *)arg;
...
delete d;
...
} This is almost perfect: you should take into account the rare case when the thread does not launch (due to insufficient resources, for instance):
void foo()
{
data* d=new data;
if(!CreateThread(...,d,...)){
delete d;
}
} That's it, hope it helps.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi Tomaz,
the problem is that CreateThread() is a c function...and c doesn't know anything about classes or virtual tables...
try this:
//---------------------------------------------------
void YourClass::AnyFunction()
{
// declarations
DWORD dwId;
// create the thread
CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)StartAddress,(LPVOID)this,0,&dwId);
}
DWORD YourClass::StartAddress(LPVOID lpParam)
{
// call the thread function
((YourClass*)lpParam)->ThreadFunction();
}
void YourClass::ThreadFunction()
{
...
}
//---------------------------------------------------
in the header you should declare the thread start procedure as follows:
static DWORD StartAddress(LPVOID lpParam);
..this should do it
|
|
|
|
|
It is working.
Thank you.
Tomaz
|
|
|
|
|
Hello,
Has anyone had problems catching WM_DROPFILES or EN_DROPFILES messages in a CRichEditView? I read msdn and believe I'm doing everything correctly but I can't seem to catch that message.. I have tried to set DragAcceptFiles(TRUE) in my Init() then in WindowProc() I try to catch WM_DROPFILES.. I have also added ENM_DROPFILES to the eventmask of my rich edit control and tried to catch EN_DROPFILES message and that hasn't worked either.. Here's what I've tried..
in WindowProc()
if (message == WM_NOTIFY)
{
if (((LPNMHDR)lParam)->code == EN_DROPFILES)
{...}
}
if (message == WM_DROPFILES)
{...}
Any ideas??
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
OnDropFiles should work. See Help under CWnd::DropFiles.
As far as I know, OnDropFiles is already impelemented in CRichEditView. So you have to override this function! That's why you never get notified, because the base installation alredy captured the message.
G. Steudtel
|
|
|
|
|
Would you tell me what API support to recognize CD-ROM status when i push the button eject on CD-ROM. Example it can recognize there are CD in CD-ROM or not.
|
|
|
|
|
char szBuffer[256];
mciSendString("status cdaudio media present", szBuffer, sizeof(szBuffer), NULL);
TRACE("szBuffer = ]%s[\n", szBuffer);
|
|
|
|
|
An alternative to DavidCrow's method:
#include <windows.h>
#include <sys/types.h>
#include <sys/stat.h>
bool drive_present(const char letter)
{
char nul_file[]="#:\\NUL";
nul_file[0]=letter;
DWORD error_mode=::SetErrorMode(0);
::SetErrorMode(error_mode|SEM_FAILCRITICALERRORS);
struct _stat st;
int res=_stat(nul_file,&st)==0;
::SetErrorMode(error_mode);
return res!=0;
} Use drive_present with the drive letter of the CD.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
A Visual C++ application, if run on a system having VC++ not installed, asks for a number of ".dll" files.
Kindly tell me how to make an installer package so as to be able to run it on a machine not having VC++.
In Visual Basic, we have a utility called Package and Deplyment Wizard for this purpose.
I am not able to find any such thing in VC++ .
Gaurav Gumber
|
|
|
|
|
use Depends (look in Microsoft Visual Studio\Common\Tools\DEPENDS.EXE)to list the dlls you'll need to distribute, or
If you are in Multi-Threaded DLL code generation mode you'll need
msvcrt.dll
If you have are using STL and you are in Multi-Threaded DLL code generation mode,
then you'll need to redist msvcp60.dll .
If you have linked to MFC then you'll need the mfc dll(s) which will depend on what parts of MFC you use. At least mfc42.dll
You can save yourself a lot of heartache and simply link statically (Multithreaded instead of Multi-Threaded DLL) to the crt and link statically to MFC.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
|
|
|
|
|
|