|
My file support word and page count and i write this properies in summary information stream.
I repeat: I save my file wiht my file format and i write word i page properties in the Summary information stream. Properties didn't showed in File Properties/Summary tab. When i rename my saved file with extension .doc then File Properties/Summary tab show properties.
|
|
|
|
|
so i have:
CString input;
int length;
input = "0x2";
length = input.GetLength();
char a[10];
itoa(length, a, 10);
AfxMessageBox((CString)a); //DEBUG
length should = 3, but it's giving me 0.
am I doing something wrong?
Kitty5
|
|
|
|
|
I got 3 when I used your code to test it.(That's what you needed . Isn't it)- VisualStudio 6.0 & Checked on .NET2003 (MFC Dialog based Application)
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
-- modified at 7:57 Wednesday 21st June, 2006
|
|
|
|
|
|
there is no problem with this code!!! its working fine in my VC++ 2003 compiler without having any problem. its showing "3" as the result. here is an altenative way.
CString input("0x2");
CString strMsg;
strMsg.Format("Length:%d",input.GetLength());
AfxMessageBox(strMsg);
SaRath.
"Do Next Thing..."
Understanding State Pattern in C++
|
|
|
|
|
yeah... i'm using VS 2005...
Kitty5
|
|
|
|
|
|
Hey, The code is giving 3 in my system.
There is nothing wrong in your code.
Still if u r not getting 3.Try this way.
CString output;<br />
output.Format("%d",length);<br />
AfxMessageBox(output);
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
|
|
toxcct wrote: AfxMessageBox(CString(a));
What is wrong using AfxMessageBox((CString)a); ??
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
|
Then what does AfxMessageBox(CString(a)); mean ??
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
|
CString(a) is the preferable way, but (CString)a does not give compilation error and works too because of available cast from char * to CString , thanks to the CString( const char *) constructor.
Actually AfxMessageBox requires const char * , so it should be AfxMessageBox(a) . Otherwise a redundant creation of temporary CString object occurs.
|
|
|
|
|
Gr8...Very helpful..Thanks for the explanation my dear Friends.
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
Ok i think I have a ghost in my computer.
it's working fine now... and i didn't change anything!
grrr.
Kitty5
|
|
|
|
|
kitty5 wrote: AfxMessageBox((CString)a); //DEBUG
There is no need to cast a to a CString .
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I'm using function system ("regsvr32 filename.ocx") and it's work OK.
But I'm doing this every time I run my Application, because I'm not sure if the OCX Control is registered or not. When App start the black cmd window is showing up, because of the system function. I don't want this window to appear always.
Is there a way to check the registry if the control is already registered or is there another way to register the Control without using system function.
This Application should be work on window 98 and above.
Thank you,
|
|
|
|
|
ZaebanB wrote: Is there a way to check the registry if the control is already registered
Use standard Registry APIs like RegQueryValue
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
That seems quite an ugly solution. Why don't you provide an installer with your app ? And let the installer do the job of installing and registering the control ? These kind of things are never done in the app itself...
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
You can use ShellExecute instead of calling system. regserver has a silent mode registration. pls see the help by calling regsvr32 /?
Try to create the control first, if it fails, depends on on the error code, register the control.
Hope you clear
SaRath.
"Do Next Thing..."
Understanding State Pattern in C++
|
|
|
|
|
ZaebanB wrote: When App start the black cmd window is showing up, because of the system function. I don't want this window to appear always.
So don't use it. That's an antiquated function from pre-Windows days. Use CreateProcess() instead. See here.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
HCRET lpfnDllRegisterServer = NULL;
DLLName = "YouDLLName.dll";
hDLL = LoadLibrary(DLLName);
if (hDLL != NULL)
{
lpfnDllRegisterServer = (HCRET)GetProcAddress(hDLL, "DllRegisterServer");
if(NULL == lpfnDllRegisterServer)
{
//ERR
}
else
{
if(FAILED((*lpfnDllRegisterServer)()))
{
ERR ("Tripio registration failed!");
}
else
{
//"Registering DLL Success"
}
}
FreeLibrary ( hDLL );
}
else
{
ERR("LoadLibrary failed");
}
|
|
|
|
|