|
|
I saw picture on your profile but I have a question when he stop works and why he never use of mouse
|
|
|
|
|
vc++ 2005
System::Void Form1_Paint(System::Object^ sender, System::Windows::Forms::PaintEventArgs^ e) <br />
{<br />
<br />
System::Drawing::Drawing2D::GraphicsPath ^shape =<br />
gcnew System::Drawing::Drawing2D::GraphicsPath();<br />
<br />
shape->AddEllipse(0, 0, this->Width, this->Height);<br />
<br />
this->Region = gcnew System::Drawing::Region(shape);<br />
<br />
}
|
|
|
|
|
This question is on the Visual C++ / MFC not (Managed) C++/CLI
|
|
|
|
|
I'm confused. What's the difference between these 2 boards ?
What do MFC and CLI mean? Sorry for such a nooobish questions
|
|
|
|
|
|
Hello,
How i can change LocationName property of IWebBrowser2 ?
I try to use GetProperty/PutProperty but it's not works:
BSTR bstrPropName = L"LocationName";
VARIANT varPropValue;
varPropValue.vt=VT_BSTR;
varPropValue.bstrVal=L"this is a test";
m_spWebBrowser->PutProperty(bstrPropName,varPropValue);
it's not return any error but not change LocationName value
Can you give me any example of using GetProperty/PutProperty ?
Thanx for help !
|
|
|
|
|
You are mis-using BSTR . You need to create them properly with SysAllocString() , or use a wrapper class like _bstr_t or CComBSTR .
|
|
|
|
|
What Michael mean by his answer is, you could modify your code like this,
BSTR bstrPropName = SysAllocString(L"LocationName");
VARIANT varPropValue;
varPropValue.vt=VT_BSTR;
varPropValue.bstrVal=SysAllocString(L"this is a test";)
m_spWebBrowser->PutProperty(bstrPropName,varPropValue);
SysFreeString(varPropValue.bstrVal);
SysFreeString(bstrPropName);
|
|
|
|
|
Error msg:
c:\program files (x86)\microsoft visual studio\myprojects\window\winmain.c(44) : error C2275: 'D3DPRESENT_PARAMETERS' : illegal use of this type as an expression
I am not sure what is causing this error. I have the DirectX 9.0 SDK installed. I am using Visual C++ 6.0 and added d3d9.lib and the directory for the include. The only thing different is I have Vista Premium 64 bit version. The windows code works fine. I can't get it to compile DirectX headers? I have also tried it with the free version of Visual c++ 2005 and still getting errors? I have tried running it as an Administrator. Any ideas how to get this working?
D3DPRESENT_PARAMETERS d3dpp;
ZeroMemory( &d3dpp, sizeof(d3dpp) );
d3dpp.Windowed = TRUE;
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
d3dpp.BackBufferFormat = D3DFMT_UNKNOWN;
if( FAILED( g_pD3D->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd,
D3DCREATE_SOFTWARE_VERTEXPROCESSING,
&d3dpp, &g_pd3dDevice ) ) )
{
return E_FAIL;
}
|
|
|
|
|
The problem is that the D3DPRESENT_PARAMETERS is not defined. Make sure you have included the correct headers in the correct order. Your version of VS will make no difference.
|
|
|
|
|
Hi ,
I have a HDC and I want to convert it to Palette??
So I can get a color table??
How can I do that??
Every new thing you learn,Gives you a new personality.
|
|
|
|
|
dSolariuM wrote: I have a HDC and I want to convert it to Palette??
You cannot convert a DC into a palette. A DC is a container which holds many things for drawing, but it can only hold 1 of each thing at any time. It holds things like pens, fonts, brushes, bitmaps and palettes.
Usually you need to make a palette then select it into the DC. Can you tell me why you need a palette? maybe then I will be able to give you a better solution.
|
|
|
|
|
Hello,
how it is possible to register and then get the message WM_DWMWINDOWMAXIMIZEDCHANGE from system?
"Windows can register to hear about when other windows have been maximized"
I have tried to check for the message ... but I will never get this message ;-(
(Desktop Composition is enabled)
LRESULT CALLBACK wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message)
{
case WM_DWMWINDOWMAXIMIZEDCHANGE:
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
return 0;
}
Thanks,
Regards michi
|
|
|
|
|
This may be a dumb question, but your app is running under Vista, right?
/ravi
|
|
|
|
|
i'm doing a dialog with this browse for folder box and i'm thinking to add more parameters/flags to the BROWSEINFO. So anyone have a list of things to put in the browsinfo, like default dir, toolbars and more?
this is what i got now, makes a box with title "hello" and OK, Cancel and New folder buttons
BROWSEINFO bi;
memset(&bi, 0, sizeof(bi));
bi.hwndOwner = hOwner;
bi.lpszTitle = "Hello";
bi.ulFlags = 0x0060 | BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS; //more flags?
//more bi. things?
thanx
|
|
|
|
|
|
thanks, that was really helpful.
|
|
|
|
|
..i'm getting an error when using bi.ulFlags = BIF_USENEWGUI;
error C2065: 'BIF_USENEWUI' : undeclared identifier
heres the code i'm using, i must be doing something wrong:
#include "shlobj.h" //dont know if it matters
BOOL BrowseForFolder(HWND hOwner, CString& folderpath)
{
::OleInitialize(NULL);
// Create a pointer to a MALLOC (memory allocation object)
// then get the Shell Malloc.
IMalloc* pMalloc = 0;
if(::SHGetMalloc(&pMalloc) != NOERROR)
return false;
// Now create BROWSEINFO structure, to tell the shell how
// to display the dialog.
BROWSEINFO bi;
memset(&bi, 0, sizeof(bi));
bi.hwndOwner = hOwner;
bi.lpszTitle = "hello";
bi.ulFlags = BIF_USENEWUI | BIF_RETURNONLYFSDIRS;
// Now show the dialog and get the itemIDList for the selected folder.
LPITEMIDLIST pIDL = ::SHBrowseForFolder(&bi);
if(pIDL == NULL)
return false;
// Now create a buffer to store the path, thne get it.
char buffer[_MAX_PATH];
if(::SHGetPathFromIDList(pIDL, buffer) == 0)
return false;
::OleUninitialize();
// Finally, set the string to the path, and return true.
folderpath = buffer;
return true;
}
|
|
|
|
|
rolfhorror wrote: error C2065: 'BIF_USENEWUI' : undeclared identifier
the error message relevant to the:
rolfhorror wrote: bi.ulFlags = BIF_USENEWUI | BIF_RETURNONLYFSDIRS;
You've missed the letter 'G' int the BIF_USENEWGUI
Fresh eye seems to be helpful sometimes :]
|
|
|
|
|
Newbie00 wrote: Fresh eye seems to be helpful sometimes :]
Sometimes yes, but probably not now It's really BIF_USENEWUI , not BIF_USENEWGUI .
|
|
|
|
|
ahaa so why did You use the sentence:
"..i'm getting an error when using bi.ulFlags = BIF_USENEWGUI;"
at the top of your question? There is definitely BIF_USENEWGUI
|
|
|
|
|
But in the code he used the correct one
|
|
|
|
|
As written in the documentation, the BIF_USENEWUI flag is supported only by version 5.0 and higher.
Therefore, define _WIN32_IE to 0x0500 or higher before including the shlobj.h file. Normally you define this in the StdAfx.h file, which gets included before all other header files.
|
|
|
|
|
thanks, i'll try that
(..regarding the error posted i meant to write "BIF_USENEWUI" not ..GUI)
|
|
|
|