|
I guess I'm missing what you're trying to do.
It seems to me a FPS calculation should be done when each frame
(or multiple of frames) is rendered, not during an idle event,
unless the idle event is the only time a new frame is rendered.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi all,
Is there any function or API, which give me the name of opened .exe or file name and path(by right click->Open or by double clicking) from any drive or desktop.
thanks
|
|
|
|
|
Look at tlhelp32.h and shellapi.h and the Process32Next function
|
|
|
|
|
Could somebody know the even for the scrolling of middle mouse scroll?
I want to update the client region when user scrolls the middle mouse scroll.
|
|
|
|
|
|
Hello Sir
How to Import C# DLL in C++ Application .please replay me
Thanks!!
Raju !!!
|
|
|
|
|
Yea its working fine ...
Raju !!!
|
|
|
|
|
I define a class MyObject. I want to use PropertyGrid to browse and modify the attributes of myObject (MyObject object).
Can I reach this goal? If the answer is "Yes". Could sombody tell me how to do?
ref class MyObject
{
public:
int x;
int y;
int rx;
int ry;
};
private: System::Void FormProperty_Load(System::Object^ sender, System::EventArgs^ e)
{
MyObject^ myObject=gcnew MyObject();
propertyGrid1->SelectedObject = myObject;
}
|
|
|
|
|
I had used public property to solve this problem. But... I meet another problem.
If SelectedObject is a nested object like basicobject, how to show the parameters of basiceffect in PropertyGrid?
public ref class BasicEffect
{
public:
BasicEffect(void)
{
}
virtual ~BasicEffect()
{
}
public:
[Browsable(true)]
property System::Boolean loop
{
bool get()
{
return _loop;
}
void set(System::Boolean value)
{
_loop=value;
}
}
private: System::Boolean _loop;
};
public ref class UIObject
{
public:
UIObject(void){_basiceffect=gcnew BasicEffect()};
virtual ~UIObject(void){};
public:
[Browsable(true)]
property int x
{
int get()
{
return _x;
}
void set(int value)
{
_x=value;
}
}
public:
[Browsable(true)]
property BasicEffect^ basiceffect2
{
BasicEffect^ get()
{
return _basiceffect2;
}
void set(BasicEffect^ value)
{
_basiceffect2=value;
}
}
private: int _x;
private: BasicEffect^ _basiceffect2;
};
modified on Thursday, November 19, 2009 3:32 AM
|
|
|
|
|
first please download the PDFLibNet.dll from here: http://www.codeproject.com/KB/files/xpdf_csharp/PDFViewer.zip[^]
it's ok like this:
<br />
Assembly a = Assembly.LoadFile("PDFLibNet.dll");<br />
but exception like this:
byte[] b = File.ReadAllBytes("PDFLibNet.dll");<br />
Assembly a = Assembly.Load(b);<br />
throwing FileLoadException, telling me it could not verify the code or could not pass policy check. .net thinks that it is not a valid assembly.
I found a solution here: http://nonodes.spunow.co.uk/2009/04/assemblyload-c-cli-assembly-gives.html[^] telling me to build the C++ assembly with /clr:safe, but is there any other way out?
Regards,
unruledboy_at_gmail_dot_com
http://www.xnlab.com
modified on Tuesday, November 17, 2009 10:16 PM
|
|
|
|
|
I want to modify the AutoScrollMinSize of Form1 by the code as below:
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e)
{
this->AutoScrollMinSize.Width=1000;
this->AutoScrollMinSize.Height=1000;
}
But it still not be active. Could somebody know how to modify the AutoScrollMinSize of Form1?
PS:already set Form1's AutoScroll as True.
modified on Tuesday, November 17, 2009 3:24 AM
|
|
|
|
|
a Size is a struct, hence a value type; you can't just modify part of it to modify the object. Assign a new Size with the width AND height you want.
Luc Pattyn [Forum Guidelines] [My Articles]
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
Size is a struct, so when you directly modify its properties, you are actually modifying a copy of it. (Actually modifying two copies of it in your code, one for width and another for height ).
Use something like this:
this->AutoScrollMinSize = gcnew Size(1000,1000);
|
|
|
|
|
Could somebody know how to put any type controls on Toolstrip?
I want to put TrackBar and DomainUpDown controls to the Toolstrip.
|
|
|
|
|
System::Drawing::Bitmap ^pBitmap;
System::IntPtr intPtr = pBitmap->GetHbitmap();
//How to convert this IntPtr to HBITMAP
//HBITMAP hbitMap = intPtr
VIBIN
"Fool's run away,where angle's fear to tread"
|
|
|
|
|
Assuming HBITMAP's type is defined somewhere (it is a HANDLE,
which is a void*)
HBITMAP hbitMap = intPtr.ToPointer();
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
FolderBrowserDialog FolderBrowserDialog1;
//FolderBrowserDialog1.RootFolder=System::Environment::SpecialFolder::Startup;
|
|
|
|
|
Something like,
FolderBrowserDialog folderBrowser;
folderBrowser.SelectedPath = Application::StartupPath;
Best wishes,
Navaneeth
|
|
|
|
|
The application's current working directory can be obtained
with System::IO::Directory::GetCurrentDirectory().
The current working directory is not necessarily the same as
the startup path
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks. I has solved this problem.
|
|
|
|
|
My CLR project have many Split Containers, one Container has a customed user control.
I want to Render a cylinder with DirectX9 on the user control.
Could somebody tell how to get windows handle of user control or render with DirectX?
|
|
|
|
|
reference: http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/71bfe0b7-7609-4c8b-b106-f901e8f379b1[^]
It depends on how your "customized user control" is implemented. However, it comes down to using the windows handle (HWND) and passing that to your DirectX device.
If you're using MFC, everything derives from CWnd. You'll want to use CWnd::m_hWnd.
If you're using Windows Forms with C++/CLI, everything will derive from Control, and you can use Control.Handle.
--------------------------------------------------------------------------------
Reed Copsey, Jr. - http://reedcopsey.com
|
|
|
|
|
That is my partial source code:
public ref class PreviewView : public System::Windows::Forms::UserControl
{
LPDIRECT3DDEVICE9 d3ddev;
private: void initD3D(HWND hHandle)
{
d3d = Direct3DCreate9(D3D_SDK_VERSION); // create the Direct3D interface
ZeroMemory(pd3dpp, sizeof(*pd3dpp)); // clear out the struct for use
pd3dpp->Windowed = true; // program windowed, not fullscreen
pd3dpp->SwapEffect = D3DSWAPEFFECT_DISCARD; // discard old frames
pd3dpp->hDeviceWindow = hHandle; // set the window to be used by Direct3D
LPDIRECT3DDEVICE9 d3ddevTmp;
// create a device class using this information and information from the d3dpp stuct
d3d->CreateDevice(D3DADAPTER_DEFAULT,
D3DDEVTYPE_HAL,
hHandle,
D3DCREATE_SOFTWARE_VERTEXPROCESSING,
pd3dpp,
&d3ddevTmp);
d3ddev=d3ddevTmp;
}
When I create device, I must use another variable d3ddevTmp to return the D3DDevice and then set to d3ddev member variable. If I use d3ddev to create device, it will appear the error message as below:
Error 1 error C2664: 'IDirect3D9::CreateDevice' : cannot convert parameter 6 from 'cli::interior_ptr<Type>' to 'IDirect3DDevice9 **' d:\svn\......\PreviewView.h 121
Could somebody tell me how to solve this problem?
|
|
|
|
|
You have to "pin" d3ddev which is currently controlled by the GC. That is, assign it to a pin_ptr<D3DDevice>.
Greetings - Jacek
|
|
|
|
|
Thanks. I has solved this problem.
|
|
|
|