|
You have to search for automation. For example Word automation or Excell automation. You should be able to find a lot of resources about that with google. This website has also some resources about automation.
|
|
|
|
|
What MSOffice documents in particular are you wanting to read? You can use automation to do most tasks, but you would always need the relevent MS program to be installed on the machine. Ie. if you want to read .xls file, you will need to have MS Excel installed.
You could however attempt to read the file directly, for this you would need to know exactly how the file is structured. Try searching for "Compound document" along with the filetype.
|
|
|
|
|
Basically, I intend to read Word and Excel documents and I believe that in most cases I will have MSOffice installed on the machine.
Vinicius
|
|
|
|
|
waldermort wrote: You can use automation to do most tasks, but you would always need the relevent MS program to be installed on the mach
I am not sure but I don't think this is true. You can simply provide a dll with your program and register it. But I don't remember which one.
|
|
|
|
|
|
Hi all,
How can I retieve the value of a registry entry? I have tried this:
<br />
res = RegOpenKeyEx(<br />
HKEY_CURRENT_USER,<br />
TEXT("My value"),<br />
0,<br />
0,<br />
phkResult<br />
)<br />
But the program bomb out....
Many thanx for any help.
Regards
Programm3r
|
|
|
|
|
did you see previous links. and this function opens specified key
|
|
|
|
|
Programm3r wrote: But the program bomb out....
What does 'bomb out' means ? Please be explicit when you encounter a problem. Is it a compilation error, an exception that is raised (which one in this case, ...).
If it's a crash, did you use your debugger to see what's happening.
I think the problem comes from phkResult. What is its value ? Did you initialise the pointer ? If not, it will contain an invalid address and the function will try to write there and crash your program.
Post some more relevant code (so when the other variables are initialised also)
|
|
|
|
|
My bad ... Let me explain, "bombs out" means that the program raised an exception that was caught by one of the Windows exceptions, and caused the famous "Send / Don't Send" dialog to pop-up.
But i do think you are right about the "phkResult" variable..., but the question remains how does one get the value of a registry entry?
Thanx for the response.
Regards
Programm3r
|
|
|
|
|
|
Thanx i'll try it...
Regards
Programm3r
|
|
|
|
|
Mention KEY_READ as fourth parameter. And how phkResult is initialized.
|
|
|
|
|
Thanx for the response, I thought phkResult was receiving a value ... thus I declared it as: PHKEY phkResult; but, this might the problem right?
Regards
Programm3r
|
|
|
|
|
Better declare it as HKEY hkResult; and pass its address as parameter.
|
|
|
|
|
Thanx I'll try it...
Regards
Programm3r
|
|
|
|
|
Programm3r wrote: but, this might the problem right?
Yes this is the problem. Better do that this way:
HKEY hkResult;
And pass the address of the key to your function (&hkResult)
|
|
|
|
|
Try something like this (I haven't tested this):
-----
// Open the key.
HKEY hKey;
LONG res = RegOpenKeyEx(
HKEY_CURRENT_USER,
_T("Software\\My Company\\My Product"),
0,
KEY_READ,
&hKey
);
if (res==ERROR_SUCCESS)
{
// Now read a value in the key we opened.
DWORD Value; // Value to read.
DWORD Type;
res = RegQueryValueEx(
hKey,
_T("My value"),
NULL,
&Type,
reinterpret_cast<const BYTE*>(&Value),
sizeof(Value)
);
if (res==ERROR_SUCCESS)
{
if (Type==REG_DWORD)
{
// Access data in 'Value'.
}
}
// Close the key.
RegCloseKey(hKey);
}
Steve
|
|
|
|
|
i have a function Accept() to which i have passed a reference of SOCKADDR_IN.
SOCKADDR_IN clientName;<br />
Accept(*m_pSrcClientSocket,(SOCKADDR*)&clientName,&len);
now i want the requested system's ip address. when i am accessing it form clientName.sin_addr.s_addr - i am getting a long. How can i conver it ot ip address form. like (127.0.0.1).
Thank you.
KIRAN PINJARLA
|
|
|
|
|
gethostbyaddr
The gethostbyaddr function retrieves the host information corresponding to a network address.
gethostbyname
The gethostbyname function retrieves host information corresponding to a host name from a host database.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thank you.
If i have a CSocket object pointer *m_pClientSocket which is passed to Accept(), Can we know the ip address from that?
KIRAN PINJARLA
|
|
|
|
|
hi,
i am new to vc++,i am doing program on richedit(like chat window),i took two richedit controls and one button also, i am typing some text in first richeditcontrol afterthat i click on buttoncontrol or press enter then the text will display second richeditcontrol.
anyone please help me,
thanks.
kanth
|
|
|
|
|
muravi wrote: display second richeditcontrol.
Don't be in a hurry man.Be patient.
See my reply to your previous post...
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
While i'm inserting the list control in a dialog, if i close the dialog, it crashes.. It aborts at setItemText of the list control.
How can i gracefully exit? There is a chance that the user can click the "OK" button in the dialog while the list control in the dialog is getting filled.
Any clues please?
Thanks
Raji
|
|
|
|
|
set a flag before starting filling operation and reset it after completion of operation.
You can check it in OnOk ,OnCancel and decide whether to exit or not.
Alternatively you can use synchronization classes.
|
|
|
|
|
Whats error?do you use from debugger?
|
|
|
|