|
hi is there any option to get display the files and folders in removable drive using SHGetSpecialFolderLocation
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
deeps_cute wrote: hi is there any option to get display the files and folders in removable drive
no.... you have to use CFileFInd there!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
Dear all,
Can anyone tell me if there is any API for accessing command prompt and get the result of the command back to the application ?
Thanks for your prompt reply.
Nikhs
Nikhil Trivedi
|
|
|
|
|
Nikhil Trivedi wrote: accessing command prompt
Search CP[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
ThatsAlok wrote: Search CP[^]
Thanks Dear. But I want to send commands from my application and have the result back to the application like
if I want to use the netsend command then how can I using visual C++ ?
Nikhs
Nikhil Trivedi
|
|
|
|
|
Nikhil Trivedi wrote: if I want to use the netsend command then how can I using visual C++ ?
You should use corresponding socket API's, instead of following this approach.
However, you can refer Console functions[^], and see what fits your needs.
Prasad
MS MVP - VC++
|
|
|
|
|
Thanks for your reply. But actually I used the netsend command for example purpose only. I want to use some commands like cd directory, cd.., and run some .exe from console.
Can you help me in that ?
Thanks for your prompt reply.
Nikhs
Nikhil Trivedi
|
|
|
|
|
Nikhil Trivedi wrote: I want to use some commands like cd directory
There is equivalent of very command you like to run from command prompt. You can use CreateDirectory in this case.
Nikhil Trivedi wrote: and run some .exe from console.
You can use ShellExecure, CreateProcess for this purpose. Refer its documentation.
Prasad
MS MVP - VC++
|
|
|
|
|
Check out my group
http://groups.myspace.com/HereCometheFourHorsemenofApocalypse
|
|
|
|
|
This is no place to spam.
|
|
|
|
|
no please don't say that for anyone!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Can you explain why we must check it
|
|
|
|
|
lol. don't even ask why... ^^
|
|
|
|
|
Joiner123 wrote: http://groups.myspace.com/HereCometheFourHorsemenofApocalypse
read.. what to do next???
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
Hello,
I am using a thread to receive a data continously and store the in the list control. The data which i received will be updated frequently. I my project, if i click one row in the list control, that particular record will be displayed in the next formview's list control. The second listcontrol record should also updated in synchronous with the first list control items.
Will you please suggest me, how i can use the thread which i have used in the first list control to update the field in second's list control in the next dialog or formview. Is there any other way to solve my problem.
Please help me.
regards
Jagannathan
|
|
|
|
|
Hello,
i am trying to create a box with sphere packing in 3D. during the compilation, if i run with smaller radius of sphere ( r=2), it is working fine. but if i increase to r=4 and increased the box size as well to fit those spheres within the cube,i m getting error as a segmentation fault. as i m beginner with programming, i couldn't fix this error. any suggestions ?. Thanks for the clarifications.
rsanju
|
|
|
|
|
The error you mentioned is obvioulsy runtime error, not compliation error. Try to debug the code, giving you this problem.
Post some relevent code , to asses the problem.
Prasad
MS MVP - VC++
|
|
|
|
|
Hi, I am using the Visual Studio 2005 Professional with SP1. When I tried to create my own custom control as described in "Creating Custom Controls By Chris Maunder" and "Creating and Using custom controls in VC++ By Yogesh M Joshi" (thanks to them by the way... ). In debug mode, program exits as soon as it starts with a memory leak error.
The steps I took to create the control is as follows,
1) I created a dialog based application (Unicode support & Static Library).
2) I created a new MFC class named "CMyCustomClass" which inherits from CView.
3) I declared and defined a public function to register the class. Code of this classs is given below
#define CLASS_NAME _T("CustomClassCtrl")
BOOL CMyCustomClass::RegisterScreenSaverClass(void)
{
HINSTANCE hInst = ::AfxGetInstanceHandle();
WNDCLASS wndcls;
if (!(::GetClassInfo(hInst, CLASS_NAME, &wndcls)))
{
wndcls.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;
wndcls.lpfnWndProc = AfxWndProc;
wndcls.cbClsExtra = wndcls.cbWndExtra = 0;
wndcls.hInstance = hInst;
wndcls.hIcon = NULL;
wndcls.hCursor = ::AfxGetApp()->LoadStandardCursor(IDC_ARROW);
wndcls.hbrBackground = (HBRUSH)::GetStockObject(WHITE_BRUSH);
wndcls.lpszMenuName = NULL;
wndcls.lpszClassName = CLASS_NAME;
if (!AfxRegisterClass(&wndcls))
{
::AfxThrowResourceException();
return FALSE;
}
}
return TRUE;
}
4) I called this function from "CMyCustomClass" constructor.
5) I dragged and droped a custom control in the dialog window and set its class name as "CustomClassCtrl".
6) There is no more addion to the project just these steps.
7) When I compile and run the code. The following error occurs. (By the way I couldn't understand why dumping objects announced a path in drive "f:", my Visual Studio is installed in "c:")
Detected memory leaks!
Dumping objects ->
f:\sp\vctools\vc7libs\ship\atlmfc\src\mfc\occmgr.cpp(195) : {69} normal block at 0x003F4AE8, 24 bytes long.
Data: < > 01 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00
{68} normal block at 0x003F8F98, 16 bytes long.
Data: < > FF FF FF FF 00 00 00 00 00 00 00 00 00 00 00 00
Object dump complete.
The program '[2672] Screen Saver.exe: Native' has exited with code 0 (0x0)
I have been searching for the answer for a long time now and found none yet...
Thanks for all the help.
-- modified at 18:46 Friday 20th April, 2007
|
|
|
|
|
The memory leak may be the result of the crash not the cause.
Try setting some breakpoints and see where the code is crashing.
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
cp9876 wrote: Try setting some breakpoints and see where the code is crashing.
Well, I set some breakpoints and all I can see is that code is exiting not with an exception but at the end of the OnInitDialog() function. This seems to be the normal place to exit so there is something that happens inside the code that I didn't write.
cp9876 wrote: The memory leak may be the result of the crash not the cause.
Well, I cannot say whether it is the cause or the result but it seems so strange. I didn't create any dynamic objects. I only created one custom control. Why is there a memory leak???
|
|
|
|
|
f:\sp\vctools\vc7libs\ship\atlmfc\src\mfc\ is where that source code was when it was compiled. That is the value of its __FILE__ string.
|
|
|
|
|
So here is my code:
In main:
if(!m_movie.OpenMovie(L"Test.avi", hdc))
return false;
Function:
bool MoviePlayer::OpenMovie(const WCHAR* cwMovie, HDC hdc)
{
if(cwMovie == NULL)
return false;
m_hdc = hdc;
if(AVIFileOpen(&m_pAviFile, cwMovie, OF_READ, NULL))
return false;
...
My Problem is when it gets into the function cwMovie is jibberish. I've tried, passing in a char* instead and calling A2CW() but that didn't work either the same thing happened when it was a LPCWSTR. If any one can tell me how I can get it to not be jibberish that would be much appreciated.
|
|
|
|
|
I don't see a problem. Are you passing a L"" string literal just like you've shown?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
yeah, and I am pretty sure I don't need to cast it in the AVIOpenFile function to a LPCWSTR. I've try cleaning and rebuilding. I don't know what to do anymore.
|
|
|
|
|
Well if you're getting garbage at the entry to the function - well, that shouldn't be happening
in the code you've shown.
The AVIFileOpen() function, OTOH, takes a LPCTSTR, which needs to be a const char* for non-Unicode
builds or a const wchar_t * for Unicode builds.
Is your code compiled for Unicode?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|