|
What is the parent of your dialog? The main window of your app? Try to make the desktop the parent and make sure your dialog has the "app window" style to make it appear on the taskbar.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Main Window Not destop. I could not find to change it to Desktop
Rajesh
|
|
|
|
|
How did you create your modeless dialog? Show code please.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
As Code-o-mat suggested, you need to set the desktop as the parent for the Modeless dialog.
You have the parent on create itself.
CWnd* pParentWnd = GetDesktopWindow();
pMyModeless->Create( IDD_DIALOG1, pParentWnd );
Величие не Бога может быть недооценена.
|
|
|
|
|
Here is an example:
class AA
{
public:
int GetTest(int i) {return 1;}
};
class BB:public AA
{
public:
int GetTest(char*ppp) {return 1;}
void MyTest()
{
GetTest(3);
}
};
I hope function GetTest(int) of base-class AA still can be used in sub-class BB as described in error line above.
any idea or it is impossible?
|
|
|
|
|
includeh10 wrote:
GetTest(3);//error line
Change to:
AA::GetTest(3);
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Try the following:
AA::GetTest(3);
It's time for a new signature.
|
|
|
|
|
|
includeh10 wrote: not what I need
Well, thank you for such a detailed description of your problem!
Exactly how do you expect people to help you solve your problems without explaining what those problems are in detail. We cannot read your mind or guess at the results of your compilations or tests from thousands of miles distance.
It's time for a new signature.
|
|
|
|
|
includeh10 wrote: not what I need
Then what do you need? The previous answer is correct, and does answer your question. A virtual function is overridden, and the only way to access a base class implementation is to explicitly specify the base class as the other user has indicated.
|
|
|
|
|
in class BB add: using A::GetTest;
|
|
|
|
|
I'm trying to run some sample code from the Microsoft site that demonstrates Unicode normalization:
http://msdn.microsoft.com/en-us/library/dd319092(v=VS.85).aspx[^]
It compiles, but I get two link errors:
Linking...
UnicodeTest.obj : error LNK2019: unresolved external symbol __imp__NormalizeString@20 referenced in function "void __cdecl TryNormalization(enum _NORM_FORM,wchar_t *)" (?TryNormalization@@YAXW4_NORM_FORM@@PA_W@Z)
UnicodeTest.obj : error LNK2019: unresolved external symbol __imp__IsNormalizedString@12 referenced in function "void __cdecl TryNormalization(enum _NORM_FORM,wchar_t *)" (?TryNormalization@@YAXW4_NORM_FORM@@PA_W@Z)
Debug\UnicodeTest.exe : fatal error LNK1120: 2 unresolved externals
The DLL with these functions is on my system here:
C:\Windows\System32\normaliz.dll
So why am I getting the link errors? If I try to define the stuff it says is not defined, I then get an error that it's already defined.
|
|
|
|
|
I never used NLS, but expect NLS to have some lib, mostly Normaliz.lib.
U have linking error, so try after including Normaliz.lib for linking.
Величие не Бога может быть недооценена.
|
|
|
|
|
i'm stuck with this problem
well i made this header "shapes.h"
#ifndef SHAPES_H
#define SHAPES_H
#define maxC 80
#define maxV 25
#define maxP 150
struct circles
{
int count;
float radius[maxC];
b2Vec2 center[maxC];
};
struct polygon
{
int count;
int vertex_count[maxV];
b2Vec2 vertex[maxP][maxV];
};
circles cl;
polygon pg;
#endif
sry for lame data structure but had to take like that
i've included it in my main.cpp
and thr's another header "simulate.h"
that needs to be included in "main.cpp"
now the problem is i have to include "shapes.h" in "simulate.h" too.. but when i do that i get error
1>simulate.obj : error LNK2005: "struct polygon pg" (?pg@@3Upolygon@@A) already defined in main.obj
1>simulate.obj : error LNK2005: "struct circles cl" (?cl@@3Ucircles@@A) already defined in main.obj
1>editor/Debug\editor.exe : fatal error LNK1169: one or more multiply defined symbols found
i tried removing "shapes.h" from "main.cpp" with "simulate.h" included in "main.cpp" and "shapes.h" included in "simulate.h" but still get the same error.
please help... i'm using Visual Studio 2008
modified on Friday, April 2, 2010 3:57 PM
|
|
|
|
|
There are two ways to deal with this. One is to put the word "extern" in front of the declarations in the header file and then in one and ONLY one place (main.cpp most likely) add those declarations again without the "extern" in front of them.
The second option is to do this -
In the header file :
#ifdef DECLARE_GLOBALS
#define GLOBAL
#else
#define GLOBAL extern
#endif
GLOBAL circles cl;
GLOBAL polygon pg;
Then in just ONE of the .cpp files, again like main.cpp, do this :
#define DECLARE_GLOBALS
#include "shapes.h"
This scheme can work with virtually any global variables if you really need to use them.
|
|
|
|
|
may be i did someting wrong but with what u have told i'm getting the error
1>main.obj : error LNK2001: unresolved external symbol "struct polygon pg" (?pg@@3Upolygon@@A)
1>main.obj : error LNK2001: unresolved external symbol "struct circles cl" (?cl@@3Ucircles@@A)
1>editor/Debug\editor.exe : fatal error LNK1120: 2 unresolved externals
please tell me how should i include my headers now... both in main.cpp and simulate.h ir is thr any other way
|
|
|
|
|
If you have an unresolved external error from the linker then you did not do what I said to exactly. Copy and paste the two definitions I showed in the previous post and put them where I said they need to go and it should work fine. I have used this technique for a long time with several different compilers and not had any problems.
|
|
|
|
|
In addition to what Rick has been telling you, maybe you should spend some time studying the difference between definition and declaration? Possibly something about storage classifiers and scope?
You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
|
|
|
|
It is not a good idea to create global variables inside a header file.
So create a shapes.cpp file and put the global variables inside them.
In the shapes.h header file put the extern keyword before the global variable creation statement as mentioned in the other posts.
|
|
|
|
|
Hi,
I have read Jeffery Richter book On Duplicating Object Handles and am still confused how to get a real process handle
so...
If I am in a Childprocess trying to duplicate its handle for the Parent
I tried the following code in the Child Process
p.s. can some one point to where the documentation is for for using code tags for code snipets
I was sure it was on the menu bar from the Home page .....
<br />
<br />
snap_shot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);<br />
<br />
process32.dwSize = sizeof(PROCESSENTRY32);<br />
<br />
return_cde = Process32First(snap_shot,&process32);<br />
<br />
pid = GetCurrentProcessId();
<br />
while(pid != process32.th32ProcessID)<br />
{<br />
return_cde = Process32Next(snap_shot,&process32);<br />
}<br />
<br />
parent_process = process32.th32ParentProcessID;<br />
<br />
then DuplicateHandle(GetCurrentProcesId(),GetCurrentProcessId(),parent_process,&child_process_handle_in_context_of_parent,0,FALSE,DUPLICATE_SAME_ACCESS);
no Luck
In Parent process
<br />
<br />
return_code = CreateProcess(NULL,<br />
(LPCSTR) &child_buff[0],<br />
NULL,<br />
NULL,<br />
TRUE,<br />
NULL,<br />
NULL,<br />
NULL,<br />
&si,<br />
&pi);<br />
<br />
global_area_handle = pi.hProcess<br />
<br />
the DuplicateHandle(GetCurrentProcessId(),GetCurrentProcessId(),global_area_handle,&parent_in_context_of_child_handle,0,FALSE,DUPLICATE_SAME_ACCESS);<br />
<br />
no luck<br />
<br />
thankx
|
|
|
|
|
ForNow wrote: can some one point to where the documentation is for for using code tags for code snipets
Did you see the code block button at the top of the edit screen?
It's time for a new signature.
|
|
|
|
|
Is this a "feature" of VC 6.0 only?
The associated list box puts the scroll bar on the right and aligns the text on right also.
Now the user have to select the list box from left and select from the list box on right.
It is not a major problem, but...
Only constructive comments to the subject will be appreciated.
No lectures please.
Thanks for reading.
Vaclav
|
|
|
|
|
Vaclav_Sal wrote: Only constructive comments to the subject will be appreciated.
No lectures please.
What does the documentation say?
It's time for a new signature.
|
|
|
|
|
Right aligned text
Specifies that text is right-aligned within the dialog box. Type: Bool. Default: False.
|
|
|
|
|
Hi Forum
I have problem to write string in text file.I have a file which is create through admin account now i want to write string from lmited user account.I ahve use CStdioFile for create a file.Here is code
if( myFile.Open("C:\\Documents and Settings\\All Users\\Documents\\Adminfile.txt", CStdioFile::modeCreate | CStdioFile::modeWrite | CStdioFile::modeNoTruncate, &e ) )
{
myFile.SeekToEnd();
myFile.WriteString("AdminSting");
myFile.Close();
}
How can i write data in this file?
please help me.
|
|
|
|