|
|
Hi,
I have an MFC MDI app that I have used to develop a CView derived class that does some pretty involved OpenGL rendering. Nothing heavy computationally, just very focussed on a customers needs.
I now need to apply what I have done in such a way that it can be wrapped by an ActiveX control.
Aside from buying a good book, that I naturally intend to do, can anyone tell me if it possible to reuse the CView derived class
Any pointers would be greatly appreciated to get me going until the book arrives...
Matthew
|
|
|
|
|
Yes you should be able to reuse this by wraping it in a MFC ActiveX. The book would be the best to help you, I like to avoid using MFC and ActiveX in the same sentence. Damn! Did it twice.;)
|
|
|
|
|
Check this site:
http://www.wzw.tu-muenchen.de/~syring/ActiveX/
Jonathan de Halleux, Belgium.
|
|
|
|
|
Does anyone know how to load an icon into the statusbar without using MFC ? I need this to a COM server in wich I'm not using MFC.
thanx
/John
|
|
|
|
|
|
Do you know of any examples on this, I don't seem to be clever enough to get it running with the explanation of SB_SETICON in MSDN : ), at least not yet that is.
|
|
|
|
|
I don't seem to be clever enough to get it running with the explanation of SB_SETICON in MSDN
Hmmm... That's a real problem. Which part of the explanation you don't understand?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I don't know how to create a handle to my icon.
I hope I made it clear that I want to create the icon in the "taskbar statusbar". Just left of the clock that is. In MSDN I found something called Shell_NotifyIcon is this perhaps what I should use ?
Thanks for helping me out !
/John
|
|
|
|
|
I don't know how to create a handle to my icon
LoadIcon
I hope I made it clear that I want to create the icon in the "taskbar statusbar"
Quite the opposite - you asked for icon in statusbar. Statusbar != taskbar. There's no such thing as "taskbar statusbar" (however, it would be pretty good name for pub visited by developers)
In MSDN I found something called Shell_NotifyIcon is this perhaps what I should use
Yes.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Seems like I got it wrong, what I ment was Taskbar Status Area.
I have gotten so far that I can create default icons (100-105), but still not the ones that I create. I assume that I don't use LoadIcon correctly.
|
|
|
|
|
I can create default icons (100-105)
What do you mean by 'default icons' (100-105)? The predefined icons (the ones with IDI_ prefix) have numeric identifiers well above 32000.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
If I call MAKEINTRESOURCE(101), i get a yellow warining triangle. Numbers 100-105 shows Icons, the others that I have tryed are empty.
My own Icon is defined in the resource.h
#define IDI_ICON1 101
In the .rc file the icon is defined like this:
IDI_ICON1 ICON DISCARDABLE "MyIcon.ico"
But if I make the call
LoadIcon(g_hInstance, MAKEINTRESOURCE(IDI_ICON1) )
an empty space will show.
I have tryed to change the define to some other number and call that number with MAKEINTRESOURCE. That also creates empty space.
The cpp file:
/*--------------------------------------------------*/
#include <stdio.h>
#include <windows.h>
//#include <commctrl.h>
#include <shellapi.h>
#include <winuser.h>
#include "resource.h"
//#import "Comctl32.dll"
//#define IDI_ICON1 1
#define WM_TRAYMESSAGE WM_USER
HINSTANCE g_hInstance;
static VOID ShowNotifyIcon(HWND hWnd,BOOL bAdd)
{
NOTIFYICONDATA nid;
ZeroMemory(&nid,sizeof(nid));
nid.cbSize=sizeof(NOTIFYICONDATA);
nid.hWnd= NULL;
nid.uID=0;
nid.uFlags=NIF_ICON | NIF_MESSAGE | NIF_TIP;
nid.uCallbackMessage=NULL;
nid.hIcon =LoadIcon(g_hInstance, MAKEINTRESOURCE(101) );
lstrcpy(nid.szTip,TEXT("Dryer is active"));
if(bAdd)
Shell_NotifyIcon(NIM_ADD,&nid);
else
Shell_NotifyIcon(NIM_DELETE,&nid);
}
void main(void)
{
ShowNotifyIcon(NULL,1);
Sleep(3000);
ShowNotifyIcon(NULL,0);
}
/*----------------------------------------------------------*/
resource.h:
/*----------------------------------------------------------*/
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by Icon1.rc
//
#define IDI_ICON1 101
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 102
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
/*----------------------------------------------------*/
The project is a console application in VC++ 6
|
|
|
|
|
I am new to programming and was wondering how to successfully add a class to a Dialog based project. I am using VC++ 6.0. I am trying to add the CxShadeButton class, that is posted on this site, in to my project. I tried
the 4 steps listed in the source code but keep receiving "Program termination error message". When I exit C++, I then get the blue screen. Any input would be appreciated. I did download the demo and it worked great.
Thank you.
Annette
mailto:mannette@gte.net
|
|
|
|
|
I have a modeless property sheet class derived from CPropertySheet to provide a dialog box with a tabbed control on it. I want to add some controls above the tabbed part.
Where do I need to handle this (OnCreate , OnInitDialog , etc.)? And how do I implement it? I have tried using GetWindowRect for AFX_IDC_TAB_CONTROL (or whatever the ID is) and then using MoveWindow but it always seems to put the origin at the top left of the dialog.
Thanks,
Derek.
|
|
|
|
|
Check these KB articles: Q143291,Q140585, Q140586 and "Adding Controls to a Property Sheet" in VC++ help
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I would like to know if i could use _cpp_max to compare 2 double. If not, could i find a method which do that, or must i implement it?
thanks in advance
gerald
|
|
|
|
|
Hi all,
My recordset is open:
m_rs->Open(dbOpenDynaset, "SELECT * FROM PERSON");
.
.
.
Now, i need query on the Person table, so i have two way:
Way 1: Using of m_strFilter:
m_rs->m_strFilter = "[NAME] = 'Ali'";
m_rs->Requery();
Way 2: Using closing and then opening again:
m_rs->Close();
m_rs->Open(dbOpenDynaset, "SELECT * FROM PERSON WHERE [NAME] = 'Ali'", dbForwardOnly | dbReadOnly);
What is your idea ? which is faster for my query ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
As with most things in our world... it depends!
The general rule should be to always do a requery to cut the overhead of destruction and construction of your recordset... Remember that this happens TWO places... in your app and on the database engine. So you generally want to modify the filter and requery...
EXCEPTION:
There are times, on certain DB engines when using a Filter sets up a read only recordSet.... regardless of the MFC Documentation. In cases where you require edit or add using the filter can produce 'Recordset is not updateable' or a message to that effect!
|
|
|
|
|
Hey Guys
This may seem like a stupid question but im really stuck. Could anyone tell me what include file i need in order to do File I/O using the windows MFC.
Thanks
Peter
|
|
|
|
|
For ansii c++ file i/o, include <io.h>
For mfc file i/o (using the CFile class), you're good to go by including your stdafx.h file.
|
|
|
|
|
Does somebody know how to install an active X component
in the Microsoft Visual C++ 6.0 Install shield?
Thanks,
John
|
|
|
|
|
If you mean the InstallShield version that comes with Visual Studio 6, then you need to create a new "File Group" for self-registering files (COM objects, ActiveX Controls). After creating the file group, select it in the File Groups tab, and the right hand pane should show some settings for this file group. Double click the "Self-Registered" setting, and you can select the Yes option. This will attempt to register all of the files in this group once they've been copied.
Hope this helps - let me know if you need more info.
------------------------
Derek Waters
derek@lj-oz.com
|
|
|
|
|
Hi,
I've been looking around for some introduction on how to use the Tab control in VC++ 6. And yes I know, in many situations it is probably better to use a Property Sheet instead (blah blah), but the thing is that I don't want to use a dedicated dialog for the tab control, and don't want to mess with apply, ok and cancel buttons, I jut want to add a small tabbed area on an already existing dialog (where things have gone a bit messy).
Now, I don't really have a problem with creating the control, assigning a control object to it, to add tabs and (hopefully) to get the message interpreter working. But what I'm not really up to is how to make borderless child dialogs (created with the resource editor) pop up when I change a tab.
Is there (somewhat detailed) info about this on the web, or could someone explain to me (slowly, please) how to do this?
Thanks,
/Daniel
|
|
|
|
|
Check the KB article Q161886. It's titled "Property Sheet as the View Window of a CFrameWnd", but there's no 'real' property sheet in this sample - they create CTabCtrl and host child dialogs inside.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|