|
Hello,
After switching to release mode, the ProcessShellCommand show me a messagebox that say "error to build a empty document" and the fonction return false. I do not understand because my application was running without any problem before and now I get this problem.
What can I try to solve my problem.
Thank you
AutreChien
|
|
|
|
|
Hi,
I tried pEdit->SetWindowText("/n"); but a junk character is displayed instead of going to new line .
Plz help.
thanx in advance
|
|
|
|
|
try "\r\n"
also make sure your edit control style is ES_MULTILINE
|
|
|
|
|
Yeah.
It worked.
Thanx once again.
|
|
|
|
|
See here[^] maybe it is some helpful to you
|
|
|
|
|
what functions does netshell.dll include?
what parameters do they have?
And, thanks.
|
|
|
|
|
DllCanUnloadNow
DllGetClassObject
DllRegisterServer
DllUnregisterServer
NcFreeNetconProperties
NcIsValidConnectionName
HrLaunchNetworkOptionalComponents
HrCreateDesktopIcon
HrLaunchConnection
HrRenameConnection
InvokeDunFile
DoInitialCleanup
NetSetupRequestWizardPages
NetSetupFinishInstall
NetSetupAddRasConnection
HrDetectLegacyNetCards
HrUninitLegacyNetCardDetection
HrOemUpgrade
HrGetAnswerFileParametersForNetCard
HrGetInstanceGuidOfPreNT5NetCardInstance
NetSetupSetProgressCallback
NetSetupInstallSoftware
Open netshell.dll with Dependency Software !
|
|
|
|
|
I just want to how to use them. And, the parameters.
|
|
|
|
|
this is example how to use func in dll :
<br />
# define LWA_COLORKEY 1<br />
# define LWA_ALPHA 2<br />
# define WS_EX_LAYERED 0x80000<br />
HWND hWnd=this->m_hWnd;<br />
typedef DWORD (WINAPI *PSLWA)(HWND, DWORD, BYTE, DWORD);<br />
PSLWA pSetLayeredWindowAttributes;<br />
HMODULE hDLL = LoadLibrary ("user32");<br />
pSetLayeredWindowAttributes = (PSLWA) GetProcAddress(hDLL,"SetLayeredWindowAttributes");<br />
For parameter of functions refer to MSDN
|
|
|
|
|
diat wrote: what functions does netshell.dll include?
what parameters do they have?
What do you need exactly?
|
|
|
|
|
afx_msg void OnSize(UINT nID, int intWidth, int intHeight);
This function to change the position of all items on a dialog. Can i call this function by another function to redraw the dialog? If not, does it have another method to re-posit all items?
Thx
Another Questions:
How to set Picture control from invisible to visible?
how to get the width and the heigth of a dialog?
-- modified at 0:13 Monday 14th August, 2006
|
|
|
|
|
(1)you want to use WM_SIZE for redraw a window
(2)See ShowWindow(SW_*)
(3)See GetWindowRect(...) and ScreenToClient
|
|
|
|
|
But how to call onSize function?
And also how to set the picture control to visible??
thx a lot
|
|
|
|
|
use SendMessage(...) this method send messages to window and see WM_SIZE nWidth=LOWORD and height=HIWORD
|
|
|
|
|
If you have handle to that window, use SendMessage()for sending message to that window. Which eventually calls OnSize on that window.
i.e.
SendMessage(hWnd,WM_SIZE,wParam,lParam);
|
|
|
|
|
In case the windows(Dialog Base)is minimize status.
What is the function to use to make the windows show in screen again.
Is it ShowWindow(SW_RESTORE)?
If so, my problem is after call this function the windows will can't minimize again.
What the code I have to write with this function ?
|
|
|
|
|
This is a part of my non-MFC program, but I think you can get the idea
if(hThisApp) {
if (IsIconic(hThisApp) )
ShowWindow(hThisApp,SW_RESTORE);
SetForegroundWindow(hThisApp);
}
|
|
|
|
|
I am displaying some of the version info in an 'about' box within my app. The problem is, after reading Chinese text from the version info it kinda screws up following calls to LoadString() . I have narrowed the problem down to a single call to VerQueryValue() . This function does as it should, it reads the string from the version info and returns it. But for some reason, When calling LoadString with a resource id of IDS_13 (8 Chinese characters Shown below), instead of returning the null terminated string, it fills the provided buffer with all the strings from IDS_14 and up. If LoadString is called with an id of higher than IDS_13 the app crashes.
LPSTR GetVersionInfo(LPCTSTR csEntry)
{
LPSTR csRet = NULL;
HRSRC hVersion = FindResource( hGlobLang,
MAKEINTRESOURCE(VS_VERSION_INFO), RT_VERSION );
if (hVersion != NULL)
{
HGLOBAL hGlobal = LoadResource( hGlobLang, hVersion );
if ( hGlobal != NULL)
{
LPVOID versionInfo = LockResource(hGlobal);
if (versionInfo != NULL)
{
DWORD vLen,langD;
BOOL retVal;
LPVOID retbuf=NULL;
char fileEntry[256];
sprintf(fileEntry,"\\VarFileInfo\\Translation");
retVal = VerQueryValue(versionInfo,fileEntry,&retbuf,(UINT *)&vLen);
if (retVal && vLen==4)
{
memcpy(&langD,retbuf,4);
sprintf(fileEntry, "\\StringFileInfo\\%02X%02X%02X%02X\\%s",
(langD & 0xff00)>>8,langD & 0xff,(langD & 0xff000000)>>24,
(langD & 0xff0000)>>16, csEntry);
}
else
sprintf(fileEntry, "\\StringFileInfo\\%04X04B0\\%s",GetUserDefaultLangID(), csEntry);
if (VerQueryValue(versionInfo,fileEntry,&retbuf,(UINT *)&vLen))
csRet = (char*)retbuf;
}
}
UnlockResource( hGlobal );
FreeResource( hGlobal );
}
return csRet;
}
BOOL CALLBACK AboutProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
static char Version[20],Date[40];
if (Message == WM_INITDIALOG)
{
char *tmp = LStr(IDS_14);
tmp = GetVersionInfo("SpecialBuild");
tmp = LStr(IDS_14);
STRINGTABLE DISCARDABLE
BEGIN
IDS_01 "ÃÜÂë´íÎó"
IDS_02 "´íÎóÓû§Ãû"
IDS_03 "Unkown Pending command"
IDS_04 "´ò¿ª"
IDS_05 "Excel Îĵµ (*.xls)\0*.xls\0\0"
IDS_06 "ѧÉúÊý¾Ý (*.sd)\0*.sd\0ËùÓÐÎĵµ (*.*)\0*.*\0\0"
IDS_07 "ѧÉúÊý¾Ý (*.sd)\0*.sd\0Excel Îĵµ (*.xls)\0*.xls\0ËùÓÐÎĵµ (*.*)\0*.*\0\0"
IDS_08 "ѧÉúÊý¾Ý¿â (*.sd)\0*.sd\0"
IDS_09 "¾¯¸æ"
IDS_10 "ÄãÏë±£´æÒѾÐ޸ĵÄÉèÖÃÂð?"
IDS_11 "ID ´íÎó'input_comment'"
END
STRINGTABLE DISCARDABLE
BEGIN
IDS_12 "ûÓпÉÓõļͼ"
IDS_13 "ÎÞ·¨»ñµÃѧÉú¼Í¼"
IDS_14 "ÎÞ·¨ÏÂÔØ 'Rich Edit' ¿ØÖÆ!"
IDS_15 "ÕýÔÚ×¼±¸..."
|
|
|
|
|
Hello
I want to change window layout to RTL in a CDialog based class.
I have done it by using SetWindowLong and WS_EX_LAYOUTRTL style at runtime.
BUT POSITION OF CONTROLS ON DIALOG WILL NOT BE MIRRORED!!!
please help me...
Kamyar Souri
|
|
|
|
|
This is my first attempt at a program with classes, as I'm new to VC6. The program worked fine, until I decided to split it into multiple files with #include. I've looked for a solution but have only found answers about declaring global variables in a header file, which I don't think I've done.
Here's the code for my Animal class (this program doesn't really serve any purpose, I'm just trying to learn how to use classes).
Main.cpp:
#include <iostream>
#include "Animal.cpp"
int main()
{
Animal Lucy(5.0);
std::cout << "Lucy is ";
std::cout << Lucy.GetAge();
std::cout << " years old.\n";
Lucy.Eat();
Lucy.Sleep();
Lucy.Speak();
return 0;
}
Animal.cpp:
#include <iostream>
#include "Animal.h"
Animal.h:
class Animal
{
public:
Animal();
Animal(unsigned short int defaultAge);
Animal(double defaultWeight);
Animal(unsigned short int defaultAge, double defaultWeight);
~Animal();
unsigned short int GetAge() const;
double GetWeight() const;
void SetAge(unsigned short int newAge);
void SetWeight(double newWeight);
void Eat() const;
void Sleep() const;
void Speak() const;
protected:
void Init();
unsigned short int* itsAge;
double* itsWeight;
};
I receive the following errors when linking:
Animal.obj : error LNK2005: "protected: void __thiscall Animal::Init(void)" (?Init@Animal@@IAEXXZ) already defined in main.obj
Animal.obj : error LNK2005: "public: __thiscall Animal::Animal(void)" (??0Animal@@QAE@XZ) already defined in main.obj
Animal.obj : error LNK2005: "public: __thiscall Animal::Animal(unsigned short)" (??0Animal@@QAE@G@Z) already defined in main.obj
Animal.obj : error LNK2005: "public: __thiscall Animal::Animal(double)" (??0Animal@@QAE@N@Z) already defined in main.obj
Animal.obj : error LNK2005: "public: __thiscall Animal::Animal(unsigned short,double)" (??0Animal@@QAE@GN@Z) already defined in main.obj
Animal.obj : error LNK2005: "public: __thiscall Animal::~Animal(void)" (??1Animal@@QAE@XZ) already defined in main.obj
Animal.obj : error LNK2005: "public: unsigned short __thiscall Animal::GetAge(void)const " (?GetAge@Animal@@QBEGXZ) already defined in main.obj
Animal.obj : error LNK2005: "public: double __thiscall Animal::GetWeight(void)const " (?GetWeight@Animal@@QBENXZ) already defined in main.obj
Animal.obj : error LNK2005: "public: void __thiscall Animal::SetAge(unsigned short)" (?SetAge@Animal@@QAEXG@Z) already defined in main.obj
Animal.obj : error LNK2005: "public: void __thiscall Animal::SetWeight(double)" (?SetWeight@Animal@@QAEXN@Z) already defined in main.obj
Animal.obj : error LNK2005: "public: void __thiscall Animal::Eat(void)const " (?Eat@Animal@@QBEXXZ) already defined in main.obj
Animal.obj : error LNK2005: "public: void __thiscall Animal::Sleep(void)const " (?Sleep@Animal@@QBEXXZ) already defined in main.obj
Animal.obj : error LNK2005: "public: void __thiscall Animal::Speak(void)const " (?Speak@Animal@@QBEXXZ) already defined in main.obj
Debug/ClassTest.exe : fatal error LNK1169: one or more multiply defined symbols found
All of these files are included in the same workspace in the same directory.
|
|
|
|
|
#include "Animal.cpp"
you will almost never ever #include a .CPP file.
try #include "Animal.h"
|
|
|
|
|
I'm confused about where I should put the declarations for my classes and where to put the definitions. When reading my book I got the impression that a header file would contain only the class declarations, and that it would come with an associated .cpp file which contained the definitions. In the book they include the .cpp definition file from their main file, which then includes the .h declaration file at the top.
If I move all of the definitions from the .cpp file into the .h file with the declarations, and include the header file all at once, it works fine. But my book says that the definitions and declarations should be in different files...
Should they be in the same file, or different files, and if so, how must I include them?
|
|
|
|
|
they should be in different files (except in special cases like inline functions or templates - which you don't need to worry about here).
and you should only #include the .H files. somtimes .H files will #include other .H files.
senthryl wrote: In the book they include the .cpp definition file from their main file, which then includes the .h declaration file at the top.
that's very very unusual - there's almost no good reason to do that in 99.99% of the situations you're likely encounter. they might be trying to get out of telling the compiler to explicity compile the .CPP (by #including it, the compiler will compile it as part of the main file), but with Visual Studio, it's trivial to add the .CPP to the project so the compler can compile it separately.
-- modified at 11:16 Sunday 13th August, 2006
|
|
|
|
|
Perfect! I just stored the declarations in another header file and included that from the definition header file.
So I have main.cpp which includes Animal.h (containing the definitions) which includes Animal_Dec.h (containing the declarations).
It's odd, the book says:
"The definition must be in a file that the compiler can find. Most C++ compilers want that file to end with .c or .cpp. This book uses .cpp, but check your compiler to see what it prefers."
Apparently I didn't check my compiler to see what it prefers Although I would have thought that they would give proper instructions for VC6 anyway, since that is what the book is mainly written for...
Thanks for your help!
|
|
|
|
|
declarations go in .H files.
definitions go in .CPP. you will probably never need to #include a definition.
you should add both files types to the Visual Studio project.
|
|
|
|