|
Are you just adding the file names to the list control or do you process the files in some way while adding?
|
|
|
|
|
Well, he's just displaying the file names for these files. It must be the icons he loads for each file.
|
|
|
|
|
So let the application always read as less data as possible.
|
|
|
|
|
What kind of technique have you followed to read and update the UI? Are you using a separate thread to read data about the files? If you are doing everything with your application's main thread, there's very little hope for the UI to respond. You can manually pump messages, but I don't see it is a great idea.
I would personally use a worker thread to read data from files and post user-defined messages from the thread to the main window and let the main window handle those messages to update the UI.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
1. I created a empty win32 project in VS2008.
2. Add a very simple cpp file to the project, it compiles.
3. Try to using the precompiled header mechanism by
(
1. Add stdafx.h and stdafx.cpp to the project
2. Set the project property by selecing "Use Precompiled Header (/Yu)"
(and it'll be stdafx.h by default)
)
Then failed to rebuild all, the first error is:
d:\test\test\stdafx.cpp(1) :
fatal error C1083:
Cannot open precompiled header file:
'Debug\test.pch':
No such file or directory
I compared the compiler option with a working MFC project, the compiler command are the same, so what is the project?
|
|
|
|
|
IDE shuold generate stdafx.pch first.
to achive that, select stdafx.cpp and change precompileheader option
to create one. (maybe /Yc)
|
|
|
|
|
I tried, the option /Yc can generate the .pch file.
After that I changed /Yc to /Yu , it got
compiling error.
Also, in an MFC project, the .pch file will be generated automatically
either when I delete the .pch file or I change stdafx.h, without using
/Yc but /Yu .
I seems a little compicated.
|
|
|
|
|
Hi
I am looking for an easy way to create GUI for my application. User needs to draw dots on a plane with 3 available colours. The program will then remember the coordinates/position of these dots and let the user inpute few parameters for each dot.
This will be a GUI for a computer simulation program, an interface for setting parameters of that simulation.
Can anyone advise an easy, fast way to program it? I can write a code in Visual Studio or some other IDE.
|
|
|
|
|
I think the easiest would be to create a MFC application and use GDI to draw the points (you can use CDC::Ellipse[^] for instance). But if you are completely new to MFC, I suggest you learn MFC from the start (using a book or online tutorial).
|
|
|
|
|
I don't know anything about MFC, that's why I'd rather avoid learning it to save my time. I am looking for some control that can be used to draw shapes, but I can't find it. I know that there are such components in Java in Netbeans and now I'm looking for something similar.
|
|
|
|
|
Member 4124956 wrote: I am looking for some control that can be used to draw shapes
That's rather vague. What are you looking for exactly ?
Anyway, even if you find such a control you will still need to learn some basic stuff with MFC. You'll have that problem with whatever you will choose: a minimum knowledge of the framework you are using is always needed.
|
|
|
|
|
In Java I used a panel or sth (I can't remember terminology) which I could add to my window, and I could draw what I wanted in that panel. I could easilly check the color, position etc of everything what I painted just using the object properties, functions.
I will check what it exactly was.
|
|
|
|
|
In Java we can use jPanel, jColorChooser and classes:
java.awt.Color
java.awt.Graphics
to obtain such a GUI. This function shows the simplicity of that solution:
private void jPanel1MousePressed(java.awt.event.MouseEvent evt) {
int X = evt.getX();
int Y = evt.getY();
Graphics gr = jPanel1.getGraphics();
gr.setColor(jColorChooser1.getColor());
gr.fillOval(X, Y, 10, 10);
}
Is there anything similar in C++?
|
|
|
|
|
Hi,
im using RemoveDirectoryW() ...the problem is..
RemoveDirectoryW(L"c:\\test\\testing");
the above deletes the folder testing but when....
the path to delete is present in two LPCWSTR"s then how can i add them ie...
LPCWSTR lpPath1=L"c:\\temp\\folder1\\";
LPCWSTR lpPath2=L"testing\\tester";
i need to pass the combination of the above to RemoveDirectoryW()(finally i should delete tester).....Please let me know how can i do this....
|
|
|
|
|
Not sure what you're trying to do. Do you want to delete a directory that has sub-directories? Could you re-phrase your request a bit?
|
|
|
|
|
Yes i will .....
I need to delete a folder named "Test" which is present in the folder TEMP(Environment variable)...
im able to get the path of TEMP using...
WCHAR buffer[1042]={'\0'};
DWORD size=1042;
::GetEnvironmentVariableW(L"TEMP",(LPWSTR)buffer,size);
CString csPath;
csPath=buffer;
im able to get the path of TEMP in csPath... now i have to delete the folder Test which is inside that TEMP folder....
When i use RemoveDirectoryW() i need to pass the path(in LPCWSTR) to Test folder....so please help me to attain this....
|
|
|
|
|
|
To concatenate the two strings, you could use something like this:
LPCWSTR lpPath1=L"c:\\temp\\folder1\\";
LPCWSTR lpPath2=L"testing\\tester";
std::basic_string<WCHAR> strPath = lpPath1;
strPath += lpPath2;
RemoveDirectoryW(strPath.c_str());
This requires a #include <string> . Note that I'd recommend generic text mappings (with _T , etc.) instead of just using Unicode directly.
|
|
|
|
|
Thanks for ur support....
May i know how to achieve this if lpPath1 is a Cstring.....
|
|
|
|
|
CString strPath1 = _T("c:\\temp\\folder1\\");
CString strPath2 = _T("testing\\tester");
CString strPath = strPath1 + strPath2;
RemoveDirectory(strPath);
|
|
|
|
|
Sorry i mean to say if only lpPath1 is Cstring and lpPath2 is LPCWSTR then how can i add them and pass to RemoveDirectoryW() Please let me know.....
|
|
|
|
|
If you're compiling in Unicode mode, it's basically just the same:
CString strPath1 = _T("c:\\temp\\folder1\\");
LPCWSTR lpPath2 = L"testing\\tester";
CString strPath = strPath1 + lpPath2;
RemoveDirectoryW(strPath);
|
|
|
|
|
Hi,
sorry it"s deleting thanks.....
modified on Saturday, March 21, 2009 9:59 AM
|
|
|
|
|
Hi,
How can i get the value of Environment variables(user variables)..thru a sample ....
Please help me out....
|
|
|
|
|
TCHAR varValue[32767];
GetEnvironmentVariable(_T("PATH"), varValue, 32767);<pre>
<code>varValue</code> will (after the call) contain the path for your account.
<div class="ForumSig">Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p</div>
|
|
|
|