|
What is this 'viz' ? "Which is" ?
The error you are describing is related to the CMainDlg itself. You are referring to a member classCMainDlg somewhere in your code, and this member is not declared in the header file of the class. See the header file of CMainDlg for details, especially check the line where the error is.
The case #2 I posted back in my previous message did not tell you to add any member to the parent (CMainDlg) class. If you added members there, then you have done something wrong yourself.
In conclusion: this error has nothing to do with the method I described. It is happening because a) you have done something wrong yourself or b) have not understood my description properly.
I would ask you to post the line where this error is happening and the context where it is in. I believe that it might be in the line where you create the modeless dialog box. Remember, that the 'this' pointer always points to the current object that is executing a method. For example, if you had an object of a class created, returning 'this' from a function would return the address of the object.
Check your code and post the line where the error is happening. You probably have just mistyped something.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
hi ,
i have tried it out ..but the same problem exixts... i cudn't figure out where its going wrong ..can i have your email id so that i'll attach a small code snippet which is posing me the problem.
I gratefuly appreciate your kind gesture.
Thanking you.
Satadru.
|
|
|
|
|
Just paste the code here, and I will analyse it promptly. I prefer not to give my e-mail address away on public forums, they tend to end up to mischiveous hands
Besides, if your code had something so important that you couldn't post it here, how could you send it on e-mail either ?
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Hi
You should pass a pointer on the main window on constuctor of child dlg.
//Forward declaration
class CMainDlg;
class CChildDlg : public CDialog{
CChildDlg(CMainDlg* p_main_dlg):CDialog(...){
this->p_main_dlg = p_main_dlg;
//Now throught this->p_main_dlg you can get
//allother public members of main dlg
}
private:
CMainDlg* p_main_dlg;
};
class CMainDlg : public CDialog{
...
paublic:
int var;
void CraeteChild(){
CChildDlg dlg(this);
dlg.DoModal();
}
};
|
|
|
|
|
I need to develop a simulator of a device which when connected to the system detects its driver. I came to know this can be done by develop a Fake USB port. Is it possible by this method ? IS there any other method to do this ?Plz any one help me regarding this...
Thank you.
|
|
|
|
|
search for virtual port on google, and then check out VSPD the best one available.
My God is more powerfull Than Your God.
|
|
|
|
|
|
Virtual serial port dirver.
My God is more powerfull Than Your God.
|
|
|
|
|
Is virtual port and virtual device same?
|
|
|
|
|
You said you want usp port, this software gives you face usb port, i dont know how how exactly you are going to use it. but still this software is worth trying out.
My God is more powerfull Than Your God.
|
|
|
|
|
What I want to do is the following: (1) create a GraphicsPath; (2) create a second GraphicsPath, (3) create a Region for each path using the constructor Region(GraphicsPath*); (4) intersect these two regions getting a Region* for the intersection. Now the question: how to construct a GraphicsPath around this intersection region ? If there would be something like GraphicsPath(Region*) I wouldn't ask this question
|
|
|
|
|
Hi, how in Gods name, do i get the doman or workgroup name to wich my computer belongs to?
i cant use GetComputerNameEx() cause the app must also run on W9x machines.
ibe searched google, the msdn (online and my cd) and found nothing!
i cant belive something so apparently simple would be so hard to find!
the only thing i can think of right now, is to do the whole WNetopenEnum() / WNetEnumResource() stuff, look for my computer name, check from wich container i got it, etc.
Theres GOT to be an easier way! Please help
Thanks!
|
|
|
|
|
Hi,
Get the Local host name and use Netbios call to get Domain name. Iam not sure whether Netbios will return Workgroup name... Anyway, check out it...
It will be helpful!!
Best Regards,
A.Ilamparithi
|
|
|
|
|
Try Q155698, howto: retrieve current user and domain names on Windows 95 and 98.
However, it requires use of 16-bit code, so you need to use thunks. The article points you at other articles, explaining how this can be done.
Steve S
|
|
|
|
|
My application must do something when its main window is minimized.What message is sended when a window is minimized?
Thank you!
Yeetang
|
|
|
|
|
WM_SIZE.
Add an OnSize handler with the class wizard and check the nType parameter for SIZE_MINIMIZED.
You might want to read about this in MSDN.
Cheers,
Fredrik
"Felix qui potuit rerum cognoscere causas."
|
|
|
|
|
|
Hello, everyone!
I want to get the document file name associated with a MSWord process, for example "document 1" when you do not assigned a file name of the word application. I have get the process ID of the MSWord process and surely the HANDLE of the MSWord appication.
Are there some APIs that I can use? Can you provide me some sample codes?
Thanks in advance,
Geo
|
|
|
|
|
Due to the fact that the document name is displayed in the title bar, you can get it from there.
1.Get HWND to the Word application in question (Look up ::FindWindow)
2.Send a WM_GETTEXT message to this particular window (Look up ::SendMessage)
Peter Molnar
|
|
|
|
|
i downloaded this code and it's in c++. it's suppose to read the cpu temperature and display the result but i can't get it to run. can someone please massage it and help me get it to run becuase i don't know c++ that well. it's suppose to get the cpu temp from a winbond W83697HF/F chip.
thanks,
Rob Tomson
//
// Simple Winbond W83697HF/F chip motherboard and cpu temp reader
// Require giveio.sys driver under winXP/2000/NT
// Used compiler: visual C++ 6
// Autor: Sander Aiaots
// E-Mail: san@ejaam.com
// I also do not take any responsibility if this program should harm your computer
//
#include <iostream.h>
#include <windows.h>
#include <conio.h>
// By the manual we have two ports to use
// 0x295 - the INDEX port and
// 0x296 - the DATA port
#define INDEX 0x295
#define DATA 0x296
#define BANK_SET 0x4e // lowest three bitti set a bank, in manual lk97 and lk109
#define CPU_TEMP 0x50 // BANK 0 0x4e = xxxxx001
#define MBM_TEMP 0x67 // 0x4e = xxxxx000
// lets give us a direct I/O access under winXP/2000/NT
// this part is not needed under win9x
int inline openIO(){
HANDLE h;
h = CreateFile("\\\\.\\giveio", GENERIC_READ, 0, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if(h == INVALID_HANDLE_VALUE) {
cout << "Couldn't access giveio device\n";
return 1;
}
CloseHandle(h);
return 0;
}
int main(){
// lets give us a direct I/O access under winXP/2000/NT
// this part is not needed under win9x
if(openIO()) return -1;
// Set Bank register to BANK0
_outp(INDEX, BANK_SET);
_outp(DATA, _inp(DATA)|0x01);
//
_outp(INDEX, CPU_TEMP);
cout << "CPU temp: " << _inp(DATA) << "C\n";
// lets unset BANK register, to get Motherboard temperature
_outp(INDEX, BANK_SET);
_outp(DATA, _inp(DATA)&0xf8);
_outp(INDEX, MBM_TEMP);
cout << "MBM temp: " << _inp(DATA) << "C\n";
return 0;
}
--
There are 10 kinds of people. Those who understand binary and those who don't.
|
|
|
|
|
If you are running Windows XP/2000/NT, you must download and install the GiveIO device driver, which this code fragment is using.
Here is a link: GiveIO Device Driver[^]
Under Windows 98/Me, this driver is not required, as each application may read or write data from any port.
If you are running Windows 95/98/Me, I suggest you comment out the lines in the main function where OpenIO method is called. Otherwise the program will always fail to open the port, and thus the main function will cease it's execution.
Remember that this particular piece of code has no security-checks applied: REMEMBER TO CHECK THE PORT DESIGNATIONS AND DATA LENGTHS ON YOUR VERY OWN MANUAL AND POSSIBLY WITH THE MANUFACTURER OF YOUR MOTHERBOARD / CPU BEFORE RUNNING THIS PROGRAM.
Otherwise, the ports the program writes to/reads from might be incorrect, and thus result in data being written to somewhere where it does not belong. Such operations may cause a system-wide failure or even damaged hardware. I suggest you consult with the maker of your motherboard to make perfectly sure that the ports specified in the file are correct. If you do not, then the risks are entirely yours.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Hi!
I am writting a static library. I noticed it does not export any of the templated functions. I have been looking all over MSDN to see if there is any issue with static library and templates but nothing so far.
So the question is, is it possible to use a template function in a statically linked library?
Thanks for your answers,
Rob
|
|
|
|
|
Robert Buldoc wrote:
So the question is, is it possible to use a template function in a statically linked library?
Yes. Remember that for this to work all of the implementation of the template must be in the header file.
John
|
|
|
|
|
Well, if the template functions is implemented in the header file they are not really located in the library. The code generated by the compiler will be in the client of the library, not in the library. It cannot be any other way as the template functions are compiled when they are used. The library can't have any prior knowledge of which specializations of the template will be used.
The only way to export template functions (that I know of) is to explicit instantiate the functions in the library. See MSDN Q239436 for an explanation. However, if you explicit instatiate template member functions on VC++ 6.0 you get an internal compiler error!
br
Steen
Cheers
Steen.
"To claim that computer games influence children is ridiculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
Steen Krogsgaard wrote:
The only way to export template functions (that I know of) is to explicit instantiate the functions in the library.
Putting template functions in a library is the same as putting template source code in a .cpp. Unless you explicitlty instantiate it you can not use it outside of the .cpp file it is defined. That is why in most cases you must put it in the header file. See the following link:
http://www.codeproject.com/cpp/templatesourceorg.asp[^]
Steen Krogsgaard wrote:
However, if you explicit instatiate template member functions on VC++ 6.0 you get an internal compiler error!
I believe I have done this with dlls but most of the time I put all the header source code in the header file because I can not possibly explicitly instantiate all possible combinations of things I will want to use with the template.
John
|
|
|
|