|
John Simmons / outlaw programmer wrote: EDIT - Nevermind.
Were you able to resolve the problem, if yes, can you please post the solution, i am kinda interested in it
-Prakash
|
|
|
|
|
CFileDialog::GetFolderPath() is a wrapper for the CDM_GETFOLDERPATH message, and as such can only be used before the dialog is closed.
If you want just the directory part of the selected file, use CFileDialog::GetPathName() and PathRemoveFileSpec() .
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
Pinky, are you pondering what I'm pondering?
I think so Brain, but if we shaved our heads, we'd look like weasels!
|
|
|
|
|
so should CFileDialog::GetFolderPath() not been a protected/private member?
Thanks for the answer.
-Prakash
|
|
|
|
|
It should be a protected member. I called the function suggested by the first responder and everything is fine. :/
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
It's a wrapper for a message, making it protected would force you to make a new class derived from CFileDialog to call it, which wouldn't make sense.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
Come quietly or there will be... trouble.
|
|
|
|
|
Well, since you can't call the damn thing anyway unless you're calling it from a derived class, I don't see that my statement is all that incorrect.
I think this stuff was written before Microsoft started getting serious about code reviews. Oh, wait...
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
-- modified at 14:51 Sunday 1st January, 2006
|
|
|
|
|
When I link my project staticly with MFC I have problem with CAsyncSocket - it rises exception on Create function. Does anybody know is there any problem?
Another question (an opposite one) which dlls should be supported with a project when it is compiled with MFC as shared DLL?
Thanks.
DavidR
|
|
|
|
|
I am currently working with a CAsyncSocket derived class in VS 2005 in a static binary and I have not experienced any problems.
However, more information would be useful:
1.) What version of visual studio?
2.) What is the error code?
3.) Did you AfxSocketInit() before creating the CAsyncSocket object?
For your second question, a static build does not require any of the MFC DLL's to be distributed with the binary, as long as your not using any third party API's.
The shared build will require MFC42.DLL a MSVCRT.DLL if you are using Visual Studio 6.0. If you are using a newer MFC version then you will need to distribute the updated DLL's which could be MFC 7.0 , MFC 7.1 or MFC 8.0
|
|
|
|
|
First of all thanks for the attention.
1) VC 7.0 (2002)
2) Access Violation error
3) Yes I did, In fact when I performe a shared build there is no problem at all.
So if I understood right I need to deliver 3 dll files:
MFC42.dll
MSVCRT.dll
MFC7_0.dll
DavidR
|
|
|
|
|
Hi all, happy new year!!!
I am a C++ newbie. I am wondering is there any package or library availalbe like arraylist or vector in java??? If it does have, could somebody tell me how to import the library and how to use it please???
Thanks in advance!!!
Asura
|
|
|
|
|
There are template classes for strings, vectors, arrays, etc. you can search for them in the msdn.
-Prakash
|
|
|
|
|
The C++ Standard Template Library (STL) has vector , list and deque containers, which provide features like those Java classes. There are various on-line tutorials for STL you can find through Google[^], but if you are going to use C++ and STL seriously you should buy The Book[^].
|
|
|
|
|
the post is not c++ related.
includeh10
|
|
|
|
|
includeh10 wrote: the post is not c++ related.
void main(...)
{
printf("Happy new year!!!\n") // Error on this line.
}
It gives me an compiler error on the printf line, dont know what the error is. Any one with a clue?
-Prakash
|
|
|
|
|
1. add the include file
#include <stdio.h>
2. comple ...
compiler says:
error C2143: syntax error : missing ';' before '}'
did you see above info?
so add ";" before your //
includeh10
-- modified at 11:16 Saturday 31st December, 2005
|
|
|
|
|
humm, thanks, its working now and this is what i got as the output.
Happy new year!!!
-Prakash
|
|
|
|
|
I think forgot his original post and toke you seriously.
INTP
Every thing is relative...
|
|
|
|
|
John R. Shaw wrote: think forgot his original post and toke you seriously.
anyways Happy New year Sir
"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
|
|
|
|
|
hi, i am new to usage of CListCtrl control. I want 2 display a image column as 1st column of the CListCtrl . I want 2 prevent only this column from being resized.
Cud someone suggest me a way to do the same.
Also is it possible to conditionally hide/show the images on this column?
If possible, cud some1 send a sample code as an illustration.
|
|
|
|
|
|
Hello All,
Not to toot my own horn...well, OK...to toot my own horn
You may recall my step-by-step DCOM tutorial for VC6, which I posted at
http://www.codeproject.com/com/HelloTutorial1.asp[^]
The tutorial isn't meant to reveal the underlying theory and gory detail of DCOM itself, just like the Scribble tutorial wasn't exactly meant to tour every nook and cranny of MFC. However, the tutorial shows each step to take to build a very simple DCOM server and client.
People have been asking me to update the tutorial for VS.NET. And, at last, the new tutorial series is in the midst of being written. Check it out at
Step 1: http://www.codeproject.com/useritems/HelloTutorial1NET.asp[^]
The tutorial is written in several "Steps" -- the main parts of the process. Step 1 is linked above, and each Step contains links to every other step.
Do me a favor, and use the rating at the bottom of each step to score that Step, and post to the Steps' message boards with your questions, and also suggestions on how to make a certain Step better etc. I welcome any and all input, and both positive kudos and constructive feedback together are great. Thanks!
Sincerely Yours,
Brian Hart
Department of Physics and Astronomy
University of California, Irvine
|
|
|
|
|
// CDib operated_dib;
GLOBALHANDLE hGMem ;
OpenClipboard();
hGMem = GetClipboardData(CF_DIB);
operated_dib.GetClipBoard (&hGMem);
int n=10;
int height=operated_dib.GetHeight();
int width=operated_dib.GetWidth();
........
here is the contents of the GetClipBoard (&hGMem),I donn't know where the mistakes are?
BOOL CDib::GetClipBoard(GLOBALHANDLE hGMem)
{
pDib = (BYTE*)GlobalLock(hGMem);
m_pBitmapInfo = (BITMAPINFO*) pDib;
m_pBitmapInfoHeader = (BITMAPINFOHEADER*) pDib;
m_pRGB = (RGBQUAD*)(pDib +
m_pBitmapInfoHeader->biSize);
int m_numberOfColors = GetNumberOfColors();
if (m_pBitmapInfoHeader->biClrUsed == 0)
m_pBitmapInfoHeader->biClrUsed =
m_numberOfColors;
DWORD colorTableSize = m_numberOfColors *
sizeof(RGBQUAD);
m_pData = pDib + m_pBitmapInfoHeader->biSize
+ colorTableSize;
if (m_pRGB == (RGBQUAD*)m_pData) // No color table
m_pRGB = NULL;
m_pBitmapInfoHeader->biSizeImage = GetSize();
m_valid = TRUE;
m_width=GetWidth();
m_height=GetHeight();
return m_valid;
}
|
|
|
|
|
greenapplezlp wrote: I donn't find the mistakes!
What Errors did u get??
|
|
|
|
|
Compiling and executeing the program are successful! but when I add the program above, Compiling is successful while executeing is wrong.It emerges a dialog box,which contents are as following--RobotVideo.exe 遇到问题需要关闭。我们对此引起的不便表示抱歉......
|
|
|
|
|
I dont know what your error message is, but it looks like you doing a lot of castin....be sure that the casts are valid and that any objects you cast inherit from the object you are casting to somewhere
Pablo
|
|
|
|