 |
|
 |
This message board is for managed and mixed-mode C++ programming only: Managed C++ in VC++.NET or C++/CLI in VC++ 2005. Please post all standard C++ programming questions in the Visual C++ board[^].
cheers, Chris Maunder
CodeProject.com : C++ MVP
|
| Sign In·View Thread·PermaLink | 4.08/5 (75 votes) |
|
|
|
 |
|
 |
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
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
 |
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; }
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
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
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Could somebody know how to put any type controls on Toolstrip? I want to put TrackBar and DomainUpDown controls to the Toolstrip.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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"
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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++
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
FolderBrowserDialog FolderBrowserDialog1; //FolderBrowserDialog1.RootFolder=System::Environment::SpecialFolder::Startup;
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Something like,FolderBrowserDialog folderBrowser; folderBrowser.SelectedPath = Application::StartupPath;
Best wishes, Navaneeth
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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++
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
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?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
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?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
 |
|
 |
I have developed an application(managed + unmanaged) in VC++ using Visual Studio 2005. It can switch to either Console or to windows form depending upon the no of parameters passed to the application on command prompt console. Its basically a windows application but console has been implemented with the help of Attachconsole(), allocconsole() & freeconsole().
Now if i run a batch file, using command prompt console, all the output messages of the application can be seen on the console as shown below.
c:\test> testapp -f filename -l operationname -t otherparams filename selected.. operation in progress.. operation completed successfully!!
But if i redirect the output of the console to a text file, i dont see any messages in the text file once the operation is complete. for eg:
c:\test> testapp -f filename -l operationname -t otherparams >> logfile.txt
Clarifications i need are 1. am i missing something to log it in a text file? 2. Can output messages from the console be logged in such a fashion. if yes, how?
Thanks in advance for help/suggestions on the same.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
This looks correct to me. What happens when you type a simple command (e.g. dir) instead of your application command line?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |