|
hello
hsa anyone worked with this class? it causes me a lot of troubles, sometimes it doesnt find existing files and sometimes the CFtpFileFind::IsDirecory() is not working...
pliz help? are there any other alternatives to this class?
thanks
RG
|
|
|
|
|
I have created an OnCtlColor function to set the colors of my text boxes, labels,listbox and combo boxes. It works fine with all but the combo box.
Can the text color of a combo box be modified? If so how can it be done?
Thank you
|
|
|
|
|
I am trying to send messages to a process I created using CreateProcess().
For the send function I need a HWND handle of the process' main Window. How can I optain this handle from what I know after calling CreateProcess()?
LP
|
|
|
|
|
There's no general method for that - CreateProcess can spawn the windowless process, after all. You should use WaitForInputIdle with handle of the child process to give it a time to create its main window, and FindWindow to get the HWND of this window. You'll need the window class name, use Spy++ if you don't know what's the class name.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
|
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.
|
|
|
|