|
Hi Hans,
strange question. I haven't seen any EBCDIC in the last 30 years or so, and I think I would know when to expect it. But anyway, these are ways I would consider given some data that is supposed to be a text using either EBCDIC or ASCII:
1. binary read the first 1K bytes of it, and count ASCII letters and EBCDIC letters. As their codes are quite different, one of those must clearly outnumber the other.
2. seems like EBCDIC letters are >=128 (see http://www.astrodigital.org/digital/ebcdic.html[^]), so just looking at the ratio of number below and numbers above 128 could be quite sufficient.
3. alternative: if you are expecting some keywords, you might just search for those in either code (still using binary of course)
BTW: if the file starts with a byte-order-mask indicating UTF8 or Unicode, it won't be EBCDIC.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
good answer Luc - I was going to suggest that if he had characters in 0-127 range 'likely' he could assume ascii .. I was trying to think about the BOM, glad you had a thought.
Luc Pattyn wrote: I haven't seen any EBCDIC in the last 30 years or so, and I think I would know when to expect it.
welcome to my world - as I said to Hans, 'most of the time' your trading spec/agreement with a third party (generally sitting behind a mutha mainframe) lets you know when to expect it, and then again, sometimes not
'g'
|
|
|
|
|
Hi Luc,
Yes, I think you are right about counting letters. I'm not sure about the Unicode part, though. Apparently there is now something called UTF-EBCDIC. I'll have to read up on that.
Thanks, guys.
|
|
|
|
|
You have my profound sympathies having to deal with EBCDIC. In my industry (printing), it's a complete PITA: everybody uses a different encoding, and not even IBM can agree with itself on code pages.
|
|
|
|
|
Gary R. Wheeler wrote: You have my profound sympathies having to deal with EBCDIC. In my industry (printing), it's a complete PITA: everybody uses a different encoding, and not even IBM can agree with itself on code pages.
Agree with that. Same in communications...
|
|
|
|
|
Hi All,
I am using MAPIEx Libraries in my MFC application.
I am trying to replicate "New Mail Message" from my MFC application so that new outlook message opens up when user clicks a button from my application and gives him a chance to send the message.
It works fine when outlook is online/connected to server.
When i remove the network, the new message dosent come up and he library failes at m_pSession->OpenMsgStore
If any one encountered a similar issue or tried to use MAPIEx libraries to bring up new message when outlook is offline, please give me some inputs.
Thanks
Kasi.
|
|
|
|
|
I am having problem with communicating with 3M MT7 EX USB touch screen.
I need to send a calibrate request through C++ code, in order to do that I locate the global device path from SetupDi* functions. The global device path returned is:
\\?\USB#Vid_0596&Pid_0001#5&ee85354&0&2#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
Using this device path I successfully get a handle from CreatFile():
<code> m_hUsbDevice = CreateFile(detailData->DevicePath, GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, (LPSECURITY_ATTRIBUTES)NULL, OPEN_EXISTING, 0, NULL);</code>
When I try writing to this handle I get an error:
ERROR_INVALID_FUNCTION
The code for writing is:
<code>WriteFile(m_hUsbDevice, pucString, 8 , &dwWritten, 0)</code>
pucString is pointer to the below structure
<code>struct stCalibrate
{
Byte RequestType;
Byte Request;
short Value;
short Index;
short Length;
stCalibrate()
{
RequestType = 0x40;
Request = 4;
Value = 0x01;
Index = 0;
Length = 0;
}
};</code>
|
|
|
|
|
|
what does this have to do with C, C++, or MFC?
|
|
|
|
|
Since you're comparing outtrainset(i,j) to 0.5, a floating point value, I'd assume just like I told you before that you already have a continuous value as output. As I also said, that if statement is thresholding the output to prodice a crisp boolean answer. If you want the continuous result, just don't do the threshold!
Also, peppering the forum with repeated questions is considered bad form and will generally get you yelled at.You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
|
|
|
|
Oh, I remember you now. You're the Malaysian gal who was trying to get some fool to send her the code for her senior project a while ago. Guess you must have found one since you can't comprehend what you have. Maybe I'll report you to your school's acadamic affairs office. You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
|
|
|
|
What, you've got mental problems? Steve
|
|
|
|
|
Hi All
I want to retrive the information for Last Used On of Installed Application of Computer. please give me idea how i retrive the information LAST USED ON and Freequency Just like Add/Remove Program . we can see all the information.in control panel so we can also retrive the information. So if any one idea then please share it. so please help me. You can also provide me where is Stored the LAST USED ON and FREQUENCY information. I am waiting Your quick response.
Thanks
Rakesh
|
|
|
|
|
|
I believe 'Add/Remove Program' which has the 'LAST USED ON' column enabled utilizes the NTFS Last Access timestamp[^]
Best Wishes,
-David Delaune
|
|
|
|
|
Last two days i'm struggling in CTreeCtrl Image Drag and Drop.
I'm using MFC MDI application having two views
1. Library View
2. Project View
Both the views having Tree Structure. I can able to drag and drop an item from Library view to the Project View but while dragging i need to drag image from one view to the another. I can able to drag image up to the border of the library view(View one) when the pointer enters in to the project view(View two) it disappear and only shows the pointer.
How can i copy the image from my Library view to the Project View.
Any one please help me ...
|
|
|
|
|
You could make your own derivation of CTreeCtrl,
with a pointer to CImageList,
that will be set by CreateDragImage(..) at CYourCtrl::OnLButtonDown(..)
and deleted at CYourCtrl::OnLButtonUp(..).
You must set the first parameter of CImageList::DragEnter(..) to NULL
to allow the image to be "global".
All coordinates of the CImageList interface
will be screen-related in this case modified on Thursday, February 18, 2010 9:17 AM
|
|
|
|
|
Hi
I trying to compile a device driver and to avoid compiling in user level functions I’ve specified /NODEFAULTLIB as a makefile flag. The function memset is now reported as a non-resolved function. The memset function is available in LIBCRT.LIB however, whenever I explicitly reference this library in the makefile it generates a number of other non-resolved functions beginning with gs_ which I believe are related to kernel32.lib which is not available to driver .dll’s
Is there an alternative to the memset function I could use?
Patrick
|
|
|
|
|
You probably need to consult some of the information presented here[^], as there are many issues with kernel level code, not just memory allocation. txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
I guess you may use RtlFillMemory [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I ended up inserting the following line in the sources file and it now works:
TARGETLIBS=\WinDDK\7600.16385.0\lib\wnet\i386\libcntpr.lib
As it works I'm assuming that this is a kernel equivalent to libcnt.lib?
Patrickmodified on Thursday, February 18, 2010 7:14 PM
|
|
|
|
|
Hi All,
I am trying to install the .inf file through cmd line
rundll32 syssetup,SetupInfObjectInstallAction DefaultInstall 128 .\mfile.inf
It runs fine with wondows xp and windows 7 but in windows vista I am getting error message "Installation failed".
Even UAC also disabled. What might be the problem?
|
|
|
|
|
john5632 wrote: What might be the problem?
Same as this[^].txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
|
Provide some more information, your message gives us nothing to work with. txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|