|
Some times what you need is
GetModuleFileName .
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.
|
|
|
|
|
Wheres this program when you run your project or when a program is running?
|
|
|
|
|
I don't understand what means "path where application is saved".
If what you need is the folder from where application was started, use GetModuleFileName(NULL) or GetCommandLine to retrieve the full exe path and then PathRemoveFileSpec to get only the path.
GetCurrentDirectory can be altered during program execution (not to mention that the application itself can be configured to run in other directory than the directory where the application resides).
|
|
|
|
|
To get complete path of the current application....
TCHAR szPath[MAX_PATH];
GetModuleFileName(AfxGetApp()->m_hInstance, szPath, MAX_PATH);
Use CreateProcess() to start an application.
|
|
|
|
|
i have fetch two values duration and bitrate from the .wmv file header.
for duration i am using the GetTimeFormat.is it ok?
that values get into following datatypes
1)duration in QWORD. i have convert it into WCHAR.
2)bitrate in DWORD. I have convert it into WCHAR.
suppose the DURATION = 389660000 it will display in hh:mm:ss format like 00:00:10
bitrate = 103080 it will display in Kbps or Mbps.
amit
|
|
|
|
|
The timestamps in WMVs are generally in 100ns units.
Divide by 10000000 to get seconds, divide seconds by 60 to get minutes, etc...
Mark
|
|
|
|
|
Hello. I'm having a problem instantiating a COLeVariant object. The
snippet of code that fails is:
void CMyDoc::CreateIEObject()
{
m_pIE = new CWebBrowserApp; // this is a COLeDispatchDriver
derived class... GOOD
m_pIE->CreateDispatch("InternetExplorer.Application"); // GOOD
COLeVariant noArg; // this does not work // BAD!
m_pIE->Navigate("www.yahoo.com", noArg, noArg, noArg, noArg); //
BAD!
m_pIE->SetVisible(TRUE); // GOOD
}
The function is supposed to instantiate an IE browser and go to the
webpage specified in Navigate. I get the following compile errors:
: error C2065: 'COLeVariant' : undeclared identifier
: error C2146: syntax error : missing ';' before identifier 'noArg'
: error C2065: 'noArg' : undeclared identifier
I have included in <afxdisp.h> file.
I have verified that COLeVariant is defined in afxdisp.h. What could I be
doing wrong?
manu
|
|
|
|
|
manu_2205 wrote: COLeVariant noArg; // this does not work // BAD!
Because , it must be COleVariant not COLeVariant .
|
|
|
|
|
On previous message he writes COleVariant
|
|
|
|
|
i changed COLeVariant to COleVariant
Still now it generate compile time error.
manu
|
|
|
|
|
manu_2205 wrote: Still now it generate compile time error
What ? Is the error same as above ?
|
|
|
|
|
|
Plz help me .My project is near to end .I am just waiting to rectify this error.Plz tell me
Either I have to add some another .h file or not ?
Or any suggestion . Plz tell
manu
|
|
|
|
|
You're surely wrong somewhere. Post the code that you've got currently. Please use the <pre> </pre> tags when posting code.
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
void CMyDoc::CreateIEObject()
{
m_pIE = new CWebBrowserApp; // this is a COLeDispatchDriver
derived class... GOOD
m_pIE->CreateDispatch("InternetExplorer.Application"); // GOOD
COleVariant noArg; // this does not work // BAD!
m_pIE->Navigate("www.yahoo.com", noArg, noArg, noArg, noArg); //
BAD!
m_pIE->SetVisible(TRUE); // GOOD
}
The function is supposed to instantiate an IE browser and go to the
webpage specified in Navigate. I get the following compile errors:
: error C2065: 'COLeVariant' : undeclared identifier
: error C2146: syntax error : missing ';' before identifier 'noArg'
: error C2065: 'noArg' : undeclared identifier
I have included in file.
I have verified that COleVariant is defined in afxdisp.h. What could I be
doing wrong?
manu
manu
|
|
|
|
|
#include "afxdisp.h" is what you need. You clearly have not included afxdisp.h
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
still the problem remains same.
I also write a small program that uses 'COleVariant' class.
It also have same problem
Plz check it to wtite a hello program Plz.
I got confused what the problem is .
Plz suggest me.If ur code succedd plz send me .
Thanx in advance;
manu
|
|
|
|
|
Make sure that you have got the header file afxdisp.h in the default include directory. Try hardcoding the path of the file while including it. I am not able to think of any other reason. Is the compiler warning about afxdisp.h that it is not present?
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
Ya it is in default include directory.
Even i not include the .h file it produce the same error.
I have VS2003 and project type is win32 console project.
Is this create any problem ?
manu
|
|
|
|
|
manu_2205 wrote: I have VS2003 and project type is win32 console project.
Is this create any problem ?
Yes, it will.
You need to create porject with MFC support.
|
|
|
|
|
manu_2205 wrote: : error C2065: 'COLeVariant' : undeclared identifier
Error still says 'COLeVariant' !
|
|
|
|
|
|
Hi Cristian,
He includes this file but also he gets this error, anyway I dont know why you get vote 1
|
|
|
|
|
Don't bother, is easier to vote 1 than to fix the ***** code, isn't it?
Anyway, I see a full thread just because COLeVaRIanT is not defined in afxdisp.h or something.
|
|
|
|
|
I have a thread class (MyThrd) derived from CWinThread. MyThrd class has a memeber CSocket mysock. When i am tyring to call
mysock.Create(0,SOCK_DGRAM) in one of the MyThrd functions it is giving an exception.
Why is it so?
Thanks in advance.
KIRAN PINJARLA
|
|
|
|