|
hm I'm not sure that I understand ...
e.g. GetFileAttributes (GetFileAttributesEx) checks file/folder pointed at (first) parameter - it can be useful when you know what are you want to check.
If you want to move along your folders and theirs subfolders on your disk, better way is use FindFirstFile & FindNextFile functions.
-----------
Mila
|
|
|
|
|
Aryan S wrote: Is there any API to check whether a folder with a given name is already there in the system?
try api PathFileExists
"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
|
|
|
|
|
I have only the directory name. I dont have any path. Now I want to check whether the directory is present in my system or not (Like windows search option). Is it possible witj any API?
|
|
|
|
|
Use the FindFirstFile() /FindNextFile() pair.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
hi all,
i would like to write a small app that detects which .NET runtime (if any) are installed on the client. this way the can check for the runtime without actually having it.
if a minimum requirement is not met it forwards them to a site which has the requirement for download.
how do i actually get the .net runtime?
i can do it from c# but i dont want that.
1. should i enumerate registry (not really backward compatable) or
2. looks for fs directories (this may vary)
3. use windows API (this is where i need the help) or is there another way ?
kind regards,
g00fy
|
|
|
|
|
May somebody tell me how to get the selected text in the editView?( not using GetSelectedText() )
3ks!
|
|
|
|
|
Use GetDlgItemText()
or
GetWindowText()
Vision is Always important and so is your ATTITUDE.
Wishes.
Anshuman Dandekar
-- modified at 0:04 Friday 21st April, 2006
|
|
|
|
|
first get the edit ctrl in the CEditView using
CEditView:GetEditCtrl()
Now u will get a pointer of CEdit from which u can get the selected text
nave
|
|
|
|
|
GetWindowText() can do the trick for you.
Project4Hire.com - Find Freelance Progammers and Graphic Designers for all your project needs
|
|
|
|
|
1) Use GetEditCtrl() to get a pointer to the edit control.
2) Use the edit control method GetSel() to get the starting and ending character positions.
3) Use that information to read the selected text by using the edit controls CharFromPos() method in a loop.
INTP
Every thing is relative...
|
|
|
|
|
Hello, everyone!
I encounter a strange question.
I create a CPropertyPageEx object and pass a "HBITMAP hBitmap" as
a parameter to the CPropertyPageEx::construct()
But in Vista the bitmap can't be displayed, however in XP it can
be displayed.
Who can tell me the reason, thank you !
|
|
|
|
|
Heyho everyone,
I'm currently working on a Network Application with a Client and 3 Servers who split up work. A lot of Data has to be transfered especially to one of those servers. I worked out a Data Packet Layout and I wanted to ask you if you think that this is a good idea. Because I'm not sure. It's an XML-based Packet Communication and looks like this:
<DataPacket>
<Header>
<Some Tag>Blablabla</Some Tag>
<Another Tag>Hello World</Another Tag>
<Checksum>The Checksum</Checksum>
</Header>
<Data>
<Type>Some Type</Type>
<Length>Length</Length>
<Checksum>The Checksum</Checksum>
<Data> Our real Data ! </Data>
</Data>
</DataPacket>
So this is the layout. But I'm not really happy with it because I think this is getting a huge bunch of Data.
How would you do this ? Or do you have any improvements ? Or shall I maybe don't do this with XML and just as a binary packet ?
Thank you,
Benedikt
|
|
|
|
|
I am a C# programmer, I have the C++ complier, but not the full blown version. I was wondering if anyone would mind making me a DLL really quick, I have all the code done(not sure if it works perfectly.) I have tested the code with another small app written in C++ but it was complied using 3rd party software and that software doesn't allow DLLs to be created.
Thanks for any help!
|
|
|
|
|
I am running a program that manipulates images using int arrays as a substitute for the images. Well I can't create another one because it causes a stack overflow error.
If I make it 200x100, I have enough space. If I make it 200x200, it goes over. I have read that you can increase the stack size using /F 1024000 but that doesn't seem to work.
Any ideas?
Right now I have converted all the arrays to short instead of int as a workaround but that seems silly on a machine with 512MB of RAM.
|
|
|
|
|
|
I am not sure I am doing this right.
This is what my code looks like now:
short temparray[PICTUREARRAYHEIGHT][PICTUREARRAYWIDTH];
I am trying to use new
short * temparray = new short[PICTUREARRAYHEIGHT][PICTUREARRAYWIDTH];
but that gets an error message saying that it can't convert type short (*) to short [][320]
I can't find any examples of malloc being used with arrays.
|
|
|
|
|
short* temparray = new short[PICTUREARRAYHEIGHT * PICTUREARRAYWIDTH];
temparray[y * PICTUREARRAYWIDTH + x] = value; is a simple solution. No need to allocate an array of arrays, which you'd have to do if you had wanted to access the pixels in "2d"-fashion.
|
|
|
|
|
sleze wrote: short * temparray = new short[PICTUREARRAYHEIGHT][PICTUREARRAYWIDTH];
You can't create 2D arrays like this using new . Try this instead
short **temparray = new short*[PICTUREARRAYHEIGHT];
for (int i=0;i<PICTUREARRAYHEIGHT;i++)
temparray[i] = new short[PICTUREARRAYWIDTH];
You would also have to delete using a similar method to prevent leaks.
|
|
|
|
|
Nice Chris, i needed a good chuckle.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Forget using malloc and free or even new and delete . Do it using a std::vector . e.g.
#include <vector>
typedef std::vector<int> t_IntVec;
t_IntVec ints(200*200);
ints[1*200 + 5] = 1;
Steve
|
|
|
|
|
I'll try that tomorrow when I get back into work.
Isn't there ANY way to just increase the size of the stack so I can use plain old 2-d arrays?
|
|
|
|
|
The /STACK linker switch. See here[^].
Steve
|
|
|
|
|
That solved the normal stack overflow error.
But now I have a new one. When I try to move the window once image processing is going on, the program crashes with a stack overflow error. Increasing the stack to 10MB doesn't seem to fix it.
Any ideas?
|
|
|
|
|
I was reluctant to tell you about the /STACK switch because I had doubts that it would fix your problem - most times "the quick fix" causes more problems then it solves. 200x200 integers is just 200x200x4=[EDIT]160KB[/EDIT]. It seems unlikely that the size of the array was actually the cause of the problem. I suspect the problem is that you're recursing too deeply. Can you send a stack trace when you get the crash?
Steve
-- modified at 8:55 Saturday 22nd April, 2006
|
|
|
|
|