|
Hi
You sould not use COM object as parameters of you interfaces(why so i dont realize yet but i many times ask similar question in diffrent forums and everywhere me suggest this).In a general sense because is not way of COM
passed parameters as COM object.
But althought you can do its simple defined methods of certain interface with parameters represented you COM object
for example:
[propget, id(0), helpstring("property GetObject")] HRESULT GetObject([out, retval] ComObject** pVal);
But prefectly use not object but interfaces of this object.
Sorry for bad eanglish
|
|
|
|
|
hello
this problem has been driving me insain cause no matter what i do nothing works
i have a CDialogBar docked to the left side of the mainfraim of a MDI application.
to the CDialogBar i Placed a CPropertySheet
and so far i only created on tab (wanted to make sure it wored before i designed everything)
and it all compiles and runs fine till i go to press one of the buttons on the PropertySheet tab then i get nothing. it acts like i never set any code up for the butten at all.
anyone have any sugestions?
Jason Bird
|
|
|
|
|
I am getting a pop-up error message which says, "NMSQL.DLL, This required file cannot be loaded, Please re-install Microsoft Visual C++" What does this mean?
Thanks
"The man who reads nothing is better educated than the man who reads nothing but newspapers."- Thomas Jefferson
|
|
|
|
|
It means that NMSQL.DLL cannot be loaded. It's more than likely just not there any more. Please re-install Microsoft Visual C++.
#include <beer.h>
|
|
|
|
|
I re-installed VC++ and it works fine now. I don't know where the file went, but IT'S BACK!
Thanks, Dave
"The man who reads nothing is better educated than the man who reads nothing but newspapers."- Thomas Jefferson
|
|
|
|
|
I'm trying to compile a Directx tutorial. The compiler says that it cannot find the D3dx8.h file, so I guess it's because I'm not linking to the D3dx8.lib library. I did a search on my system and the library is NOT there. So I installed Directx 9 (I already had version 8), hoping the file would come with it but it didn't appear in a new search. Where do I get the D3dx8.lib from?
Thanks, Dave
"The man who reads nothing is better educated than the man who reads nothing but newspapers."- Thomas Jefferson
|
|
|
|
|
I believe this is directx 8 stuff. You need the directx 8 SDK.
John
|
|
|
|
|
Thanks John,
I know where it's at on MSDN, I'll install it now.
"The man who reads nothing is better educated than the man who reads nothing but newspapers."- Thomas Jefferson
|
|
|
|
|
After you do this remember to add the include and lib directories to your directories settings in visual studio so that the compiler can find the SDK.
John
|
|
|
|
|
Thanks, I did as you said and it worked.
"The man who reads nothing is better educated than the man who reads nothing but newspapers."- Thomas Jefferson
|
|
|
|
|
i am trying to hide the window after the AnimateWindow function has been called however after the animation has taken place the window does not hide despite the call to ShowWindow(SW_HIDE) any ideas how i should do this. The code is as below
<br />
void CMyApplicationDlg::OnSysCommand(UINT nID, LPARAM lParam)<br />
{<br />
if ((nID & 0xFFF0) == IDM_ABOUTBOX)<br />
{<br />
CAboutDlg dlgAbout;<br />
dlgAbout.DoModal();<br />
}<br />
else if( (nID & 0xFFF0) == SC_MINIMIZE )<br />
{<br />
Shell_NotifyIcon(NIM_ADD,pNotifyIconData);<br />
<br />
AnimateWindow(m_hWnd,500,AW_HIDE | AW_SLIDE | AW_VER_POSITIVE);<br />
<br />
this->ShowWindow(SW_HIDE);<br />
<br />
}<br />
else<br />
{<br />
CDialog::OnSysCommand(nID, lParam);<br />
}<br />
}<br />
|
|
|
|
|
I had a similar problem a while ago with a Progress Dialog. The following made it work for me:
<br />
if (IsWindowVisible())<br />
{<br />
ShowWindow(SW_HIDE);<br />
ModifyStyle(WS_VISIBLE, 0);<br />
}
Never quite figured out why though
John Hudson
Its all right - I'll tell the therapist it was all your fault, maybe they won't turn the voltage up so high on the ECT machine this time
http://www.rainbow-innov.co.uk[^]
|
|
|
|
|
nah man doesnt work for me
when i call this function
<br />
AnimateWindow(m_hWnd,500,AW_HIDE | AW_SLIDE | AW_VER_POSITIVE);<br />
it marks the style for the window as hidden however it doesnt really hide the window and when try to call ModifyStyle(WS_VISIBLE,0) it returns FALSE maybe its a bug or something
anyways thanks for the help..
|
|
|
|
|
Hi:
I add a text file(or html file) to the resource of the project, how could I get this file in the programe?I want to get its content .Is there any API function to do so?
Thanks
Benben
|
|
|
|
|
And how you have added it?
Has wrote a his path as string resource or how?
Best regards,
Eugene Pustovoyt
|
|
|
|
|
just try "import" the file to your resource
Thanks
Benben
|
|
|
|
|
Try these Win32-API functions:
FindResource
LoadResource
SizeofResource
LockResource
That will do the trick!
Yours,
Jens
|
|
|
|
|
But could you give me an demo?
Thanks
Benben
|
|
|
|
|
Sure.
Let's assume you have added a textfile to your resource with ID=IDR_TEXTFILE, and your custom resource type has the name "TEXTFILE".
You can extract the resource with the following code:
#include "stdafx.h"
#include "resource.h"
#include <TCHAR.h>
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
HRSRC hRsrc = ::FindResource( hInstance,
MAKEINTRESOURCE( IDR_TEXTFILE ),
_T("TEXTFILE") );
if ( NULL != hRsrc )
{
HGLOBAL hGlob = ::LoadResource( NULL, hRsrc );
if ( NULL != hGlob )
{
DWORD dwSize = ::SizeofResource( NULL, hRsrc );
LPVOID lpVoid = ::LockResource( hGlob );
if ( NULL != lpVoid )
{
LPCTSTR lpszString = reinterpret_cast< LPCTSTR>( lpVoid );
MessageBox( NULL, lpszString, _T("From resource"), MB_OK );
}
}
};
return 0;
}
That's it
Jens
|
|
|
|
|
|
Hmmm, one annotation:
The more I think about it the more I get convinced, that it is not allowed to just cast the memory pointer to an LPCTSTR, because the trailing zero is missing.
Instead it should be copied to an according buffer.
So it should be:
LPCTSTR lpszString = reinterpret_cast< LPCTSTR>( lpVoid );
TCHAR *tcBuffer = new TCHAR[ dwSize + 1 ];
if ( NULL != tcBuffer )
{
ZeroMemory( tcBuffer, ( dwSize + 1 ) * sizeof( TCHAR ) );
memcpy( tcBuffer, lpszString, dwSize * sizeof( TCHAR ) );
}
But this is only the case with strings.
Byte buffer or similar can't be used directly anyway (like LPCTSTR).
Jens
|
|
|
|
|
Hi all,
I want to set the screensaver timeout and screensaver..I can set the screensaver in registry..whereby it changes the screensaver in properties of desktop..but if i change the screensaver timeout in registry it doesnt change in the properties of desktop..until i restart or logoff or shutdown and restart the machine...then the change is reflected..even it doesnt even seem to realize that new value is there in registry..it always takes the value from destop properties..can anyone help..and show me some pointers or ideas on it...any help is highly appreciated..Thanks a lot in advance..
Himanshu
|
|
|
|
|
Use SystemParametersInfo, passing:
SPI_SETSCREENSAVEACTIVE to set whether the screensaver is enabled
SPI_SETSCREENSAVETIMEOUT to set the timeout.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
hi,
Thanks for the reply..but it does set the screensaver timeout and it is the same as in destop properties..but there is a flaw there..when i set thru systemparametersinfo...it starts running screensaver the same moment it passes thru the statement..I dont want that..I want only the screensaver to be set...not run the screensaver the same time..can u help..
Himanshu
|
|
|
|
|
Hi everybody,
How can I use a CString variable in regular DLL .
The compiller say "error C2501: 'CString' : missing storage-class or type specifiers" on my CString variable.
If I include < afxwin.h > to my StdAfx.h then linker say:
"nafxcwd.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in XXX.obj
nafxcwd.lib(dllmodul.obj) : warning LNK4006: _DllMain@12 already defined in XXX.obj; second definition ignored"
Best regards,
Eugene Pustovoyt
|
|
|
|