|
I got it solved!
In calling convention (Project settings->c++->advanced)
I had __stdcall (/Gz) which should have been __cdecl (/Gd)
changed it and got it working !
- KK
|
|
|
|
|
Hello, in visual studio 2005, is is possible to build the program to x64 target insted of x86.
1.will i see any imporivement with my programs?
2.should i need to use special instructions?
3. why the program wion't let me build with x64? i have 64 bit proccesor (intel pentum d)
Thank you.
|
|
|
|
|
How to speed up my Database ? i use ODBC driver visualfoxpro 6.0 database !
this is my code that fill in my CListCtrl if you have an ideea on how to speed up please tell me !!!!!
void CDtsc::FillList()
{
CDatabase_Plan* pPlan = new CDatabase_Plan();
if (!pPlan->Open())
return;
if (pPlan->IsOpen())
{
int x = 0;
while (!pPlan->IsEOF() )
{
m_list.InsertItem(x, pPlan->m_name);
m_list.SetItemText(x, 1, pPlan->m_den);
pPlan->Move(1);
x++;
}
m_list.Invalidate();
m_list.UpdateWindow();
}
pPlan->Close();
delete pPlan;
}
Bravoone
|
|
|
|
|
I can say one thing.Did you try to previous answers(of all members) and they arent helpful for you?
|
|
|
|
|
Flaviu_2006 wrote: How to speed up my Database ?
Unless you have actual metrics, this is meaningless.
Flaviu_2006 wrote: m_list.InsertItem(x, pPlan->m_name);
m_list.SetItemText(x, 1, pPlan->m_den);
Do you just refuse to pay attention?
int nIndex = m_list.InsertItem(x, pPlan->m_name);
m_list.SetItemText(nIndex, 1, pPlan->m_den);
If you are trying to (unnecessarily) populate the list control with thousands of items, that is probably your problem. How many items can you reasonably work with at any given time? Using a virtual list control has been suggested to you at least three times, yet you insist on not heeding the advice. I'm not saying it is the answer to your problem, but if you are too lazy to even try it, why bother asking for continued help?
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
didn't we answer this already ?
anyway, what is the bottleneck ? filling the list or reading from the database ?
|
|
|
|
|
You should use a virtual listctrl.
Take a look at http://www.codeproject.com/listctrl/virtuallist.asp
Vinicius
|
|
|
|
|
Hiya,
I'm making a program that'll copy random music directories (being cd's) onto my telephone memorycard. To test the basics, I first programmed a consoleapp that'll index all the dirs of my musicfolder. Below is the code thus far:
#include "stdafx.h"<br />
#include "windows.h"<br />
#include <iostream.h><br />
#include <string.h><br />
<br />
#define MAX_DIRECTORIES_CHECK 200<br />
<br />
typedef struct{<br />
int index;<br />
bool isEmpty;<br />
char foldername[120];<br />
}foldernamestruct;<br />
<br />
foldernamestruct fns[MAX_DIRECTORIES_CHECK];<br />
<br />
int listDirectories(char* directory){<br />
HANDLE hFile;<br />
WIN32_FIND_DATA FileInformation;<br />
<br />
hFile = ::FindFirstFile(directory, &FileInformation);<br />
<br />
if(hFile == INVALID_HANDLE_VALUE)<br />
return 3;<br />
<br />
strcpy(FileInformation.cFileName, fns[0].foldername);<br />
fns[0].isEmpty = 0;<br />
fns[0].index = 1;<br />
<br />
printf ("First file name is %s.\n", FileInformation.cFileName);<br />
printf(directory);<br />
printf(FileInformation.cFileName);<br />
printf("\n");<br />
printf(fns[0].foldername);<br />
printf("\n");<br />
<br />
<br />
<br />
return 1;<br />
}<br />
<br />
int main(int argc, char* argv[]){<br />
char name[120];<br />
<br />
for(int i = 0; i<MAX_DIRECTORIES_CHECK; i++){<br />
fns[i].isEmpty = TRUE;<br />
fns[i].index = -1;<br />
}<br />
<br />
if(listDirectories("C:\\Documents and Settings\\User\\My documents\\My music")!=1)<br />
return 1;<br />
<br />
<br />
<br />
cin >> name[4];<br />
return 0;<br />
}
Now, I tried to test the whole by printing the foldernames using printf(), but why won't this work Have I done something wrong? Can someone help me find the answer...
Thanks
|
|
|
|
|
Geennaam82 wrote: ...but why won't this work
What doesn't work? Is it a compiler/linker error. Is an exception being thrown? Have you stepped through the code using the debugger?
Geennaam82 wrote: foldernamestruct fns[MAX_DIRECTORIES_CHECK];
Why don't you use one of the STL containers so that you can handle any number of folders?
Geennaam82 wrote: int listDirectories( char* directory )
Since directory is not changing, make it const .
int listDirectories( const char *directory )
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hahahaha, good remark, didn't give any real error.
No the problem is that it does read the dir, as it doesn't exit with code 3. But the printf() of the directorynames don't display anything, while the other printf() with strings in them work perfectly. I'm working in VC6, since I got totally freaked while working in VC2005 with all the different string types. So the problem isn't a compile error or anything, the problem runs smoothly, but just doesn't print the foldernames.
|
|
|
|
|
Your strcpy() call looks odd. I think the arguments need to be reversed.
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Thanks man! That was it! Now to get the rest of the code working!
|
|
|
|
|
Can't see any "<"s or ">"s or what's between them. Can't read the code as it's poorly formatted (no indentation). If you don't want to make the effort to format the code nicely for us tick the "Ignore HTML tags in this message (good for code snippets)" checkbox when you post so we can see the tabs and such. Unless I'm in a really good mood or the question in particularly interesting I don't pay much attention if the code is too hard to read.
Steve
|
|
|
|
|
Hi Steve,
I'm sorry that my code is not good enough for you. It is ubersimple code! Got a main, got 1 function, that's it! I must admit that the indentations got removed when I copied the code, my appologies, didn't notice that. But still, instantly replying with this kinda rude reply wasn't necessary. Dave replied within 2 minutes and he figured it out correctly, even from the crappy format! I'll try to deliver better format in the future if you try to be a bit.... more patient.
Joe
|
|
|
|
|
It's not the code per se; it's the fact that you can't see any "<"s or ">"s charcters or what's between them and none of the formatting can be seen as the HTML doesn't honour the tabs. As I said, if you don't want to put them in manually (as I do for short code segments) tick the "Ignore HTML tags in this message (good for code snippets)" check box when you post the message and your code will be readable.
Steve
|
|
|
|
|
I write some files and folder to harddisk while I run my program.
whenever I close the program, I want to delete these files too.
I don't know what the function use for this issue.
Can Anybody help me?
|
|
|
|
|
See DeleteFile and SHFileOperation
|
|
|
|
|
Have you tried DeleteFile() and RemoveDirectory() ?
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
What about, if want to delete all file in specific folder, such as Folder "Temp"?
|
|
|
|
|
Use SHFileOperation() for wildcards.
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
I'm just a beginner. I can set the range of SpinButtn but don't know how to
deny values outside Min and Max thru keyboard input w/o using messsage box
|
|
|
|
|
Did you use CSpinButtonCtrl::SetRange
|
|
|
|
|
For the SpinButton yes it's working, problem is It allows values outside the range thru keyboard input
thanks
|
|
|
|
|
Using the ClassView, add an integer variable that is attached to the edit control. This will add a DDX_ function call in your DoDataExchange method. You will also note that there is a min and max range you can set for the variable that will add a DDV_ call in DoDataExchange.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|