|
|
The file is mixture of binary and text data. Normally, the device writes character < 255 but sometimes it screws up and write random bits which can be > 255:
Here's the kind of text I get:
1ŠÂ‚b¢ºb’šb¢‚R5,$
???
Jonathan de Halleux.
|
|
|
|
|
was another bug, soory
Jonathan de Halleux.
|
|
|
|
|
Are you referring to c-style (char* ) strings, CString , or std::string ?
- Mike
|
|
|
|
|
Thanks for replying.
I've already found a way.
William
Fortes in fide et opere!
|
|
|
|
|
Does anybody know how to get tape drive info?
Does MS provide tape API to control tape drive such as rewind etc.?
Thanx!
Williams
|
|
|
|
|
hi there,
i am writing a c++ program to make statistical analysis, which demands quite some memory (i'm using new to allocate an array and filling it with values)... whenever i need to allocate close to 200 mb the program and the computer gets really slow, taking forever just to allocate the memory... this happen when compilling on vc 6 and vc 7. when using dev c++ (mingw), the program just crashes while trying to allocate the memory... i am pretty much sure thats nothing to deal with memory leaks (all memory allocate is freed in the end), bad memory chips (i tested them using memtest) or insufficient memory (this pc runs with 2 gb of ram memory)... any suggestions on how to solve this??????
|
|
|
|
|
tguzella wrote:
whenever i need to allocate close to 200 mb the program and the computer gets really slow, taking forever just to allocate the memory
This sounds reasonable. Allocating that much requires a good deal of work by the memory manager, including lots of virtual disk activity.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Is this memory being allocated in lots of tiny chunks or as one big array?
In either case, the virtual memory manager will be working overtime to figure out how to arrange blocks and track them. If you have a whole bunch of tiny memory blocks, you might consider allocating a large pool of memory at the start of the day and writing your own allocator tuned to your requirements.
- Mike
|
|
|
|
|
Well allocating 200M sounds like a really bad idea, and is going to take quite some time. I'd be trying to find better algorithm or implementation of your algorithm that doesn't need such vast amounts of memory, or acquires it only as needed.
There are also small memory block allocators around which will considerably improve performance if you are allocating lots of small blocks.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Well I would say for me 200MB is not a lot of memory. My program allocates almost 2GB which is the maximum allowed by the version of windows I am using. I do my allocations using VirtualAlloc(). I have almost 2GB of free memory and my allocations are instantaneous (take a few microseconds if you are counting). The first thing I would say is to check task manager to see if you have any free ram before you do the allocation. Are you using any third party memory products?? The ones that claim to give you more memory?? If so disable them and see what happens...
John
|
|
|
|
|
actually i am allocating this memory for 3 arrays...
i am not using any third party allocation program... If this might be the problem, could anyone suggest me one to use (a freeware if possible ...)??? i am running this on windows 2k (sp3) (i know i should be running on a real operating system: linux/unix, not this microsoft crap; i have no one to blame but myself for sticking with windows ..), with 1.7 gb of free memory (that's why I am assuming problems are not coming from virtual memory...)
thanx...
|
|
|
|
|
If it's only three arrays, is there any way you can allocate those three at the start of the program, then just re-use them?
- Mike
|
|
|
|
|
SHGetSpecialFolderPath( NULL, szDest, CSIDL_LOCAL_APPDATA, TRUE );
Works well with Win XP, but when used with Win 98, szDest is NULL... Why? Is there another way?
Thanks!
---------------
Tired of Spam? InboxShield 2.0.2 for Microsoft® Outlook® 2K/2K2/2K3
http://www.inboxshield.com
|
|
|
|
|
I think because there is no user accounts in win98. Appplication Data is a folder which is specific for each account which there is nothing like that in win98.
Mazy
No sig. available now.
|
|
|
|
|
Even SHGetSpecialFolderPath( NULL, szDest, CSIDL_WINDOWS, TRUE ); won't work! So I guess it's not user related...
---------------
Tired of Spam? InboxShield 2.0.2 for Microsoft® Outlook® 2K/2K2/2K3
http://www.inboxshield.com
|
|
|
|
|
I guess you have to use SHGetFolderPath() . This is from MSDN:
This function is a superset of SHGetSpecialFolderPath, included with earlier versions of the Shell. It is implemented in a redistributable DLL, SHFolder.dll, that also simulates many of the new Shell folders on older platforms such as Windows 95, Windows 98, and Microsoft Windows NT® 4.0. This DLL always calls the current platform's version of this function. If that fails, it will try to simulate the appropriate behavior.
Mazy
No sig. available now.
|
|
|
|
|
|
ok, then what's the proper way to get the c:\windows\local settings\application data folder under Win98?
Thanks!
---------------
Tired of Spam? InboxShield 2.0.2 for Microsoft® Outlook® 2K/2K2/2K3
http://www.inboxshield.com
|
|
|
|
|
|
Oh, then I guess that this folder gets created when installing MS Outlook and isn't there by default. GetWindowsDIrectory() is working for me and I just add \Local Settings\Application Data\ to it.
My only concern is if \Local Settings\Application Data\ will still be in english for other languages, such as french... Anyone knows?
Thanks for your help!
---------------
Tired of Spam? InboxShield 2.0.2 for Microsoft® Outlook® 2K/2K2/2K3
http://www.inboxshield.com
|
|
|
|
|
Yes, this folder is always in English. Only folders that will be in other languages are, as far as I know, "Desktop" and "Startup".
|
|
|
|
|
For CSIDL_LOCAL_APPDATA and CSIDL_WINDOWS , you must have v5 of the common controls DLL. What version of Internet Explorer does the Windows 98 machine have?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
When I've tried to catch keyboard messages with SetWindowsHookEx(WH_KEYBOARD, KbHookingProc, hinstDll, 0), I've noticed, that only WM_KEYDOWNs are hooked.
It means that, as I make an attempt to send the message to my primary thread of execution like this:
LRESULT CALLBACK KbHookingProc(int code, WPARAM wParam, LPARAM lParam)<br />
{<br />
if (code < 0) goto ret;<br />
<br />
UINT uMsg = (lParam & KF_UP) ? WM_KEYUP : WM_KEYDOWN;<br />
<br />
PostThreadMessage(ThreadId, uMsg, wParam, lParam);<br />
<br />
ret:<br />
<br />
return CallNextHookEx(hhook, code, wParam, lParam);<br />
};
I recieve only WM_KEYDOWN messages.
So, when my primary thread tries to translate such re-sent messages, TranslateMessage doesn't work (I suppose, it depends on WM_KEYUP in some way, but I'm not sure).
|
|
|
|
|
Hi buddy
I've been searching for such a thing, but could NOT find a solution.
I thought likely you can suggest something sice you are older
Thanx in advance and here's my eMail: Marzbany@yMail.com
|
|
|
|