|
But the person is very keen about doing it with files and not with registry. That's why I suggested him those API functions to deal with INF files.
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
Okay.
If however the registry is an option, then both solutions are possible.
|
|
|
|
|
MFC tries to make this easy using the serialization capability of CDocument. Do you know if you are supposed to use that or not use that?
Login name and password are typically stored in the registry. You can use CWinApp::WriteProfileString and CWinApp::GetProfileString to easily store and restore data to/from the registry.
|
|
|
|
|
rajaasif wrote: please can anybody send code:
Oh no, not again!!! i am seeing this line pretty often these days..
vijay.
|
|
|
|
|
I am getting the runtime error: "Debug Assertion Failed" from mfc71d.dll when try to create application class object in another file.
MyApp.h<br />
class CMyApp : public CWinApp<br />
{<br />
public:<br />
---<br />
HRESULT GetCommonDevice(LPDIRECT3DDEVICE9& m_pd3dDevice_REF);<br />
---<br />
}<br />
<br />
<br />
MyWnd.h<br />
#include "MyApp.h"<br />
class CMyWnd : public CWnd<br />
{<br />
DECLARE_DYNAMIC(CMyWnd)<br />
public:<br />
CMyWnd();<br />
void init();<br />
---<br />
}<br />
<br />
MyWnd.cpp<br />
---<br />
void CMyWnd::init()<br />
{<br />
CMyApp c;<br />
HRESULT hr = c.GetCommonDevice(m_pD3dDevice); <-- Here the debug assertion at run time<br />
---<br />
}<br />
}
Any help would be greatly appreciated!
Thanks & Regards,
Suman
|
|
|
|
|
Use like this
HRESULT hr = (afxGetApp())->GetCommonDevice(m_pD3dDevice);
rather than
CMyApp c;
HRESULT hr = c.GetCommonDevice(m_pD3dDevice);
nirmal
|
|
|
|
|
if u want to acess CWinApp use AfxGetApp() .Each application that uses the Microsoft Foundation classes can only contain one object derived from CWinApp
never say die
|
|
|
|
|
rp_suman wrote: CMyApp c;
HRESULT hr = c.GetCommonDevice(m_pD3dDevice); <-- Here the debug assertion at run time
What are you doing ?
Application object is available globally.
You can use AfxGetApp() to access it.
|
|
|
|
|
Thanks for help.
I have tried using AfxGetApp() already but the App classe's functions are not listed by intellisense but only MFC's CWinApp class functions are listed. I am debugging the problem.
Thanks & Regards,
Suman
|
|
|
|
|
You need to use type casting.
i.e. your function would like this,
void CMyWnd::init()
{
HRESULT hr = ((CMyApp*)AfxGetApp())->GetCommonDevice(m_pD3dDevice);
}
|
|
|
|
|
Thank you very much for great help!
Thanks & Regards,
Suman
|
|
|
|
|
When We restart Windows, the C:\Windows\System32 opens automatically.How to stop the above operation.is there any registry settings available?
|
|
|
|
|
IMO, the most likely cause for this behaviour is that some program is (supposed to be) autostarted, but the start command contains a space character. And the command string isn't surrounded by quotes.
An example:
C:\Windows\System32\some program
This doesn't work, Windows doesn't find the program "C:\Windows\System32\some", so it opens an explorer window (showing the contents of C:\Windows\System32) instead.
The solution is to surrond the command with quotes, i.e.
"C:\Windows\System32\some program"
Now, it will work.
The problem is to find the registry setting containing the malformed command. Start searching for "C:\Windows\System32" (without the quotes) in the registry.
Then surround that command with quotes.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
Kakan,
I will try and tell the result
Thanks,
|
|
|
|
|
kakan wrote: The solution is to surrond the command with quotes, i.e.
"C:\Windows\System32\some program"
Now, it will work.
(No offence, just joking)
There is a good chance that the program is a virus . Once he finishes doing the settings, there's going to be a lot of fun
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
That's right, it might be a virus or malware.
But he won't have to see an explorer window when he logs in, though.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
kakan wrote: he won't have to see an explorer window when he logs in, though.
In that case, well he may not see windows explorer at every start up :-> But the sad thing is that he may neither see explorer nor desktop or any icons, even after startup
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
And the virus is likely to be very dangerous since the developer is causing things to happen that are not intended to happen.
|
|
|
|
|
Hi all,
I need to get the selected text in the running application. As we get the copied data from the clipboard.I want to use this in Outlook addin where it will return the selected text from the mail.Is there any provision for MailItem object in Outlook Automation?
Thanks in Advance.
The secret of life is not enjoyment
but education through experience.
- Swami Vivekananda.
|
|
|
|
|
Mahesh KulkarniI need to get the selected text in the running application. As we get the copied data from the clipboard.I want to use this in Outlook addin where it will return the selected text from the mail.Is there any provision for MailItem object in Outlook Automation?
I'm not understanding your requirement. Be more precise and just explain what your problem is. Do not give an detailed explanation of your project (unless required)
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
I want selected text from Outlook MailItem.
The secret of life is not enjoyment
but education through experience.
- Swami Vivekananda.
|
|
|
|
|
If MS Word is the editor there, then you can write it in VBA. I'm not sure, but there'd be something like selection.gettext
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
Is there any difference between the following two commands?
sprintf(oOrder.ContractName , "%s\0", ContTick.ContractName);
strcpy(oOrder.ContractName, ContTick.ContractName);
Both operands are defined as
typedef CHAR ConNameStr[11];
|
|
|
|
|
Oliver123 wrote: Is there any difference between the following two commands?
No
Not in the result, anyway.
|
|
|
|
|
Mark is correct. However, sprintf is used for copying the string with formatting, and strcopy is used purely for string copying. If you are just copying a string, why use sprintf with its apparent overhead. It also has more of a chance to cause a buffer overrun.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|