|
Hi Pradeep,
Pradeep Maskeri wrote:
I assume that you call GetsafeHWnd()in OnCreate(LPCREATESTRUCT lpCreateStruct) function or after it is called and not in Constructor
Thanks for your reply!
My OCX is a wrapper for a hardware device - And doesn't need to create any window. So, I'm not handling WM_CREATE!
Now, if you make a similar OCX using MFC, and put it in a VB Form... Then try to debug the OCX code by making the VBClient.EXE with your OCX embedded in the VB Form, you can see that the OCX control's HWND is ALWAYS 0x00000000!
But if you insert the control in the ActiveX Test Container or another VC++ (MFC) client app, and then you debug your OCX code, you will see the OCX control's HWND has a legitimate value.
This is the problem, I have! (
- Nirav
|
|
|
|
|
Oh! It is windowless.
So this may help http://www.kbalertz.com/Feedback_153582.aspx
I hope sincerely
|
|
|
|
|
hi,
i am trying to retrieve user account information from the registry. Does any one know about any MFC or some other technique to get the users and their respective information like their account details, privilages etc.
thanks
|
|
|
|
|
No idea abt any MFC . but you can use following functions...
GetUserName()
NetUserGetInfo()
It's not a bug, it's an undocumented feature. suhredayan@omniquad.com
messenger :suhredayan@hotmail.com
|
|
|
|
|
hi
i am writing a program in VC++ for reading and displaying any size bmp image in a window using gl library....anybody help me out with full code and i appreciate ur help....
thanks..
|
|
|
|
|
Hi,
In my server application in VC++,i create and execute a particular process .
when this process is running,i want to excute another process as background without
interupting the current process.How do acheive this.If to use CreateProcess()
then how to get it.Pls help
If createprocess needs to be in separate thread ,then how to acheive this.
Pls can anyone get me some sample code snippets for this.
Thnks in advance
Ram
|
|
|
|
|
cberam wrote:
If createprocess needs to be in separate thread ,then how to acheive this.
There is no need for any separate thread to use CreateProcess(); It will return immediately after creating the new process.
check following:
A newbie's elementary guide to spawning processes
[^]
It's not a bug, it's an undocumented feature. suhredayan@omniquad.com
messenger :suhredayan@hotmail.com
|
|
|
|
|
Hi,
Thanks for the reply.When the "CreateProcess" is invoked,the current process is interrupted for few seconds.which i don't want to happen.That's why i want to start
in a separate thread or as a background process.Pls do help
Thnks in advance
Ram
|
|
|
|
|
Greetings!
What is the maximum limit of the number of items we can insert in combo box. How can i retrieve or increase this limit ?
|
|
|
|
|
Combo boxes use an integer to index the items, so the theoretical limit is 2GB-1. You'll run out of memory before you hit that limit, though. And on 9x, due to 16-bit limitations, the actual limit is 32767.
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
"Just because the box has 2 gigabytes of memory doesn't mean you get to use it all!"
-- Rico Mariani, CLR perf guy
|
|
|
|
|
hi, anyone knows how to do a program to calculate loan using MFC when user inputs loan term, interest rate, and downpayment?
Thanks.
felix joe
|
|
|
|
|
having a look at CP articles can help you much than asking suxh questions...
watch this : http://www.codeproject.com/cpp/loan.asp[^]
(i don't know at all what is the loan calculator, so i hope that will help, anyway, there was many articles when i searched for it, so i think if this doesn't satisfy you, you could search by yourself).
TOXCCT >>> GEII power
|
|
|
|
|
hi !
Does anybody know how to stop a process without killing it ?
What i needed was that my program hooked windows and get notification when explorer or any other windows component calls FindFirstFile(...)
my application gets a notification message.Now based on certain settings my program must allow FindFirstFile(...) to execute ,or prevent it from execution.I have proceeded till the notification part.Currently the app is notified when FindFirstFile(...) is called.But how do i stop it?
Also the app must be cross platform friendly ...and i don't have DDK so the solution can't be driver based...
Kane
Some guys hack just to get themselves a girlfriend.What a pathetic reason huh?
|
|
|
|
|
fetch the thread list and suspend all of them.
Don't try it, just do it!
|
|
|
|
|
hi !
Does anybody know how to stop a process without killing it ?
What i needed was that my program hooked windows and get notification when explorer or any other windows component calls FindFirstFile(...)
my application gets a notification message.Now based on certain settings my program must allow FindFirstFile(...) to execute ,or prevent it from execution.I have proceeded till the notification part.Currently the app is notified when FindFirstFile(...) is called.But how do i stop it?
Also the app must be cross platform friendly ...and i don't have DDK so the solution can't be driver based...
Kane
|
|
|
|
|
How can I make a control bar float and dock inside a pane of a CSplitterWnd instead of the CMainFrame???
Doc I have to override CMainFrame DockControlBar() or something?
Thanks
How do I print my voice mail?
|
|
|
|
|
I thought I knew what I was doing, but I can't come up with any way to initialize my static character array. It's defined, in the header file as
static char var[4]; In my source file I have tried every way I know of to give it a value to no avail. Any help is appreciated as I'm sure it can be done, I obviously have no idea how though.
- Aaron
|
|
|
|
|
I am afraid that I would not really understand your idea. But I give you here an example, it may help you.
<br />
class X{<br />
public:<br />
...<br />
private:<br />
....<br />
static char st[4];<br />
....<br />
};<br />
<br />
char X::st[4]="123";<br />
static char ss[4]="abc";<br />
....<br />
|
|
|
|
|
You normally don't put a static global variable in a header file; the purpose of using such a global is to restrict its visibility to one .CPP file.
You can give it an initial value in the .CPP file like so:
static char var[4] = "abc";
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
I even hear the Windows "OMG I booted up fine" sound.
-- Paul Watson diagnosing hardware problems.
|
|
|
|
|
How would that be possible? I would like to access a MySQL database on my site from a program.
Thanks.
Michael
|
|
|
|
|
I have not done that before, but I think you could use ODBC, ADO with MySQL driver for Windows. I've ever used MySQL driver for ODBC to import mySQL data into MS Access.
|
|
|
|
|
Hi all, whenever i need some symbols/constants to be avairable to my entire application (all its files i mean), i create a header file (appconsts.h), and i #include it in each .cpp file of my application. this always worked fine, till recently, i recived some advice to stop using macros (#define) to define constants, and started using const, so (in my current project) i happily went to my appconsts.h file, and changed it like this (an example):
Before:
#if !defined(APPCONSTS_H)
#define APPCONSTS_H
#define MY_STRING _T("a string")
#define MY_NUMBER 100
enum MY_ENUM{En1=0, En2, En3};
#endif
AFTER:
#if !defined(APPCONSTS_H)
#define APPCONSTS_H
const TCHAR* MY_STRING = _T("a string");
const int MY_NUMBER = 100;
enum MY_ENUM{En1=0, En2, En3};
#endif
its all very nice, the only problem is that i now get 708 errors (yes 708), about MY_STRING and MY_NUMBER allready being defined in another object. for example:
ClientEditDlg.obj : error LNK2005: "char const * const COLHT_VLV_NOTES" (?COLHT_VLV_NOTES@@3PBDB) already defined in Boletaje.obj
onfigSheet.obj : error LNK2005: "char const * const IF_FILENAME" (?IF_FILENAME@@3PBDB) already defined in Boletaje.obj
please notice that i DID include guards on the appconsts.h file, i tried removing all the #includes to appconsts.h file, and just including it in my stdafx.h file, but no luck, and since this is a WTL project, i dont have any other file (besides stdafx.h) that gets included everywhere.
Can someone help me out?
***UPDATE***
mhh, i get it now, i should declare the consts in some .cpp file (say where my winmain()is), and then op appconsts.h i should do like this:
extern const TCHAR* MY_STRING = _T("a string");
extern const int MY_NUMBER = 100;
enum MY_ENUM{En1=0, En2, En3};
is this correct?
if so, wouldnt be easyer to just use #define instead of const? i mean, MS uses it! for example in winuser.h:
// ShowWindow() Commands
#define SW_HIDE 0
#define SW_SHOWNORMAL 1
#define SW_NORMAL 1
#define SW_SHOWMINIMIZED 2
#define SW_SHOWMAXIMIZED 3
#define SW_MAXIMIZE 3
...
what you guys think?
|
|
|
|
|
When you change to const s, you are creating global variables. As such, you have to declare/define them differently.
What's happening now is that a.cpp includes appconsts.h and sees MY_STRING is a global variable, so MY_STRING (appropriately name-decorated) goes into a.obj.
Then b.cpp comes along, includes appconsts.h, and sees MY_STRING . Same thing happens, MY_STRING goes into b.obj.
When the linker runs, it collects the obj files into an executable, but sees the multiple definitions of MY_STRING , which breaks the ODR (one definition rule: each symbol must have exactly one definition).
For a quick hack, add __declspec(selectany) to the variable definitions. The real way to solve it is in the FAQ[^]
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
You cannot stop me with paramecium alone!
|
|
|
|
|
Thanks for your answer Michael, i updated the original message before i readed your reply (i guess i was updating it while you were adding the reply , i would appreciate if you read the update and tell me what you think about using #define
|
|
|
|
|
That's still not exactly right. You don't initialize global variables in the header file, but in the .cpp file where they are defined.
appconsts.h:
extern TCHAR* FOO;
appconsts.cpp:
TCHAR* FOO = _T("Hello");
The Windows headers use #define because the API is still a C interface, and const is not supported by all C compilers (it was officially added to C rather recently).
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
There is a saying in statistics that a million monkeys pounding on typewriters would eventually create a work of Shakespeare. Thanks to the Internet, we now know that this is not true.
|
|
|
|