|
josip cagalj wrote: Now my question is, after I find out that file doesn't exist can I create it only by specifying full path-name not worrying if some of sub folders exist. It needs to recreate the whole path.
You'll have to do that separately from the file create.
And even the functions you could use to create a directory (_mkdir or CreateDirectory ) will only create a directory if its parent exists. So you're going to have to write something that recurses through a path, creating directories that don't exist in teh appropriate order.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
|
Stuart Dootson wrote: And even the functions you could use to create a directory (_mkdir or CreateDirectory) will only create a directory if its parent exists.
SHCreateDirectory will create the entire path for you.
«_Superman_»
|
|
|
|
|
Thanks - I found that just as I'd pressed the 'Post Message' button and was going to amend my post - but then found you'd beaten me to it!
I was looking in the shlwapi[^] docs for it. Silly me
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi All
Dialog based application not responding when function is call.Function is define in header file.Can any one give me advice how can i solve it?Plz help me
|
|
|
|
|
If your function is doing a lenghty operation, then it is normal that your GUI is frozen: your app is not able to process windows messages anymore (so that means not able to respond to events, not repainting itself, ...). You have to execute your function in a separate thread.
Here[^] is an excelent article that will help you understanding everything you need to know.
|
|
|
|
|
Thank for nice Article.But I need one more advice forum.Function is define in header file and all thing is doing there.So how can i use there worker thread?Plz help me
|
|
|
|
|
You have to create your thread in your dialog class, just before calling the function. You don't have to change your function at all. But I think things will be much clearer once you have read the full article.
|
|
|
|
|
Hello everybody,
i got a strange problem.
If i resize a frame (within a CFormView) all works great.
Till i replace the View with another one (the frame keeps)
All Size-Events are correctly send to the new active view.
But if I size the frame fast, the view will (sometimes) not get the newest Size-Event.
Then, a ugly mistake like this is provoked :
http://img5.imageshack.us/my.php?image=fehleruu2.jpg[^]
I tested this view already as a initial view (without changing the view into the frame ) in this
case it works also without mistakes.
Only if I replace the initial view with another one, then the second view resizes not correctly.
Also i tested if the initial view is also resized (so that wrongly 2 views are sized) but i use a Hidden-Flag to step out the OnSize-Function (but the Size-Event is send anyway to it )
Big thanks for help
|
|
|
|
|
How about handling WM_EXITSIZEMOVE[^] rather than/as well as WM_SIZE?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Yes, it's a last possibility to "resolve" it,
but if the user holds down the Mouse-Key (for example to continue the sizing) it
seems pretty ugly
But thanks for your answer
|
|
|
|
|
Hello all,
In my project I am creating a SDI application without Document/View architecture in MFC(Visaul C++ 2008).
Now in it, I am creating a child window using "Create()" method with window style "WS_CHILD" and i am calling this "Create()" method from "OnCreate()" of CMainFrame class.For this newly created child window I have created a new class.Now on this new child window I have added some controls like edit boxes, buttons and these controls are also created by "Create()" method and with "WS_CHILD" style.
Now my actual problem is that when I run the application, child window gets created and I can see the controls added on the child window also but I can not access these controls means these controls are disabled. Can anyone tell how to enable or access these controls on child window.
Thanks and Regards,
Abhijit
|
|
|
|
|
re-re-re-re-REPOST!!!!
If you didn't get any responses a week ago, how do you expect to get any this week when you have provided no extra information (for example - what classes were used to create your child windows - how about posting some code to illustrate what you're doing!
To paraphrase Einstein, "The definition of insanity is posting the same thing over and over again and expecting different results"
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
i want to setFont of a CStatic text control. i have GdiPlus::Font i want to use that.. or it will do if i will be able to convert it to same CFont.
any help
thanx
|
|
|
|
|
Here is some code for the conversion:
CDC* pDC = CDC::FromHandle(::GetDC(NULL));
Gdiplus::Graphics g(pDC->m_hDC);
Gdiplus::Font gdipFont(L"Arial", (REAL)8);
LOGFONT lf;
#ifdef _UNICODE
gdipFont.GetLogFontW(&g, &lf);
#else
gdipFont.GetLogFontA(&g, &lf);
#endif
CFont font;
font.CreateFontIndirect(&lf);
Hope this helps!
modified on Tuesday, February 17, 2009 9:25 AM
|
|
|
|
|
Hey everybody
I am REALLY stuck with this one!
I'll describe the problem with a scenario:
(1) Log to computer with user "A".
(2) start->run-> "\\somecomp\somedir\"
(3) user "A" has no access to this "\\somecomp\somedir\", thus windows pops up a window that allows user "A" to log-in to "\\somecomp\somedir\" as a different user.
(4) user "A" enters user/pass of "P" that has permission to the "\\somecomp\somedir\".
The question is:
How can I tell (from user "A"'s computer) that he uses user "P" to get to "\\somecomp\somedir\" ????
Help... please...
Thanks!
|
|
|
|
|
Hi,
in my app I have the following code:
std::ofstream f(sPath.GetBuffer(0), std::ios::binary);
f.write((const char *) pBytes, dwSize);
f.close();
I also include 'iostream.h' #include <iostream.h></iostream.h>
I'm getting error:
-error C2027: use of undefined type 'basic_ios<char,struct> >'
-error C2065: 'binary' : undeclared identifier
-error C2079: 'f' uses undefined class 'basic_ofstream<char,struct> >'
-error C2078: too many initializers
-error C2228: left of '.write' must have class/struct/union type
-error C2228: left of '.close' must have class/struct/union type
Help?
Thanks!
P.S. Using vc++ 6 on WinXP SP3
|
|
|
|
|
josip cagalj wrote: I also include 'iostream.h'
You should include <fstream> also. And iostream.h is deprecated, you should include <iostream> instead (without the .h).
|
|
|
|
|
|
Still one thing more,
how to test why std::ofstream failed.
My code:
std::ofstream f(sPath.GetBuffer(0), std::ios::binary);
fails to open file, I test that with f.is_open() , but why?
Thanks
|
|
|
|
|
Check the path you're supplying to the ofstream constructor - this little C++ program works for me, which demonstrates the library doing the right thing:
#include <iostream>
#include <fstream>
int main(int, char**)
{
std::ofstream f("a.a", std::ios::binary);
if (!f.is_open())
{
std::cerr << "File open failed" << std::endl;
}
else
{
f << "Hello";
f.close();
}
}
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
josip cagalj wrote: I also include 'iostream.h'
As well as adding in #include <fstream> , let's change that #include <iostream.h> to #include <iostream> - that's what you should be including for standard stream support
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks to you also.
Please see my new post.
|
|
|
|
|
I’ve got problem with using GDI on top of OpenGL in Windows Vista. I’ve found that if GDI graphic would be drawn before any drawing operation of OpenGL than everything what was drawn by GDI would be cleared and would be drawn everything what was drawn by OpenGL before and after. It looks like OpenGL is drawn in separate buffer which after each calling of glFlush function drawn on a screen while clearing what was drawn by GDI. One of easiest solution of the problem is to draw any GDI objects after drawing OpenGL elements, but appears the same problem when the screen spitted on 4 sides. After drawing of one screen, drawing of OpenGL elements next screen clearing GDI objects previous screen. I tried to draw everything on the screen and the copy everything to memory buffer using CDC::BitBlt and then draw this buffer using OpenGL function glDrawPixels. But I found that GDI objects are drawn after exit from CView::OnDraw function, means catch of screen using CDC::BitBlt at the end of CView::OnDraw function do not include GDI objects.
Other case is to draw GDI objects to memory and the draw them by using OpenGL functions did not tested. I am trying to find much easiest way to solve the problem.
Please, help to solve the problem.
|
|
|
|
|
Hi,
I want to move one line between two horizontal sliders, with respect to slider position... I am able to move slider tic, but not able to move line to exact sliders tic...
Is there any way to get pixels information from the slider control..
If so please kindly let me know ... It is very urgent requirement for me..
Thanks in advance..
modified on Tuesday, February 17, 2009 10:17 AM
|
|
|
|