|
I found This Article[^] right here on CodeProject. It seems to be a Profiler (which is the type of tool you're looking for). From the screenshot that comes with the article, there looks to be a "Threads" column, but I can only see the "T" and half of the "h"
It might be worth a look. And like everything here...it's free!
Bob Ciora
|
|
|
|
|
ah, good call, I was probably using the wrong search terms, many thanks.
|
|
|
|
|
No worries Glad to help. I guess I should've mentioned that a Profiler is what you were looking for.
Bob Ciora
|
|
|
|
|
I have found how to use the Link mask to make text act like an internal hyperlink. The linked text is underlined and colored to resemble a hyperlink. I am trying to remove both the underline and coloring to hide the link until it is hovered over. Is there a way to do this?
Thanks.
|
|
|
|
|
I'm trying to make a class using private inheritance from two template classes.
I've made my own String class(I'm learning from a book and it has you do this), my own Array class. the Array class is a template class, and I am using it to take a type of another template class that takes two arguments.
class Class_name: private Array< other_class<int, int> >, private String
{
public:
Class_name(int l = 10);
~Class_name();
void Set(int in = 0); //takes index for array
private:
const int len; //length of array
};
the only definition that I think is relevant is the Set() method
void Class_name::Set(int in)
{
//take input from user to pass to array
}
in this member function, I'm not sure how to call the template class type of the array's function.
using containment, I can just set a variable of array type in it and call the function using the [] operator as a reference for the class...
Thanks for your help, please let me know if I'm too vague
|
|
|
|
|
Actually, this isn't a question of inheritance, merely of scope. If you want to explicitly call Array 's Set method, you simply define the call with the proper specifier:
void Class_name::Set(int in)
{
Array<other_class>::Set(in);
}
If you don't include the Array<other_class>:: specifier, the compiler wouldn't know any better, and would end up calling Class_name::Set . This would, of course, crash your stack soon enough.
You'll find yourself doing this sort of thing a lot in C++, primarily in virtual functions that override the same function in the base class. If it's required to call the base class, then you have to explicitly define the base class specifier to force a call to the function in the base class.
Hope it helps!
Bob Ciora
|
|
|
|
|
Hi GURU,
I am getting double byte value from AS400 in EBCDIC with the values 0x43 and 0xA4. These values must be converted to be 0x83 and 0x7D.
The reason is that both values (0x43 and 0xA4) will made a single character which is represented by PC code as 0x83 and 0x7D.
Please look at the scheme below:
--------------------------------------------------------------------
| EBCDIC | ASCII |
--------------------------------------------------------------------
| 0x43 | 0xA3 |
| 0xA4 | 0xCF |
| 0x43 and 0xA4 | 0x83 and 0x7D |
--------------------------------------------------------------------
As you can see from the scheme above, if I do single byte conversion, 0x43 will becomes 0xA3 and 0xA4 will becomes 0xCF. However, if double byte conversion, the value 0x43 0xA4 will become 0x83 and 0x7D.
The problem I have is when I am using MultiByteToWideChar(), it is intepreted 0x83 as single value and 0x7D as another value. Therefore the result of the conversion is 0xA3 and 0xCF. My question is, how can I made MultiByteToWideChar() knows that both 0x43 and 0xA4 are double byte values that made 1 single character?
This is the code that I did:
<br />
const int IBMCodePage = 20290;
const int PCCodePage = 932;
<br />
BYTE byteEBCDIC[2] = {0x43, 0xA4};<br />
BYTE byteASCII[2];<br />
wchar_t wchBytes[1024];<br />
DWORD dwSize;<br />
<br />
dwSize= MultiByteToWideChar(IBMCodePage , MB_PRECOMPOSED, (const char*)byteEBCDIC, 2, wchBytes, 1024);<br />
dwSize= WideCharToMultiByte(PCCodePage , WC_COMPOSITECHECK | WC_SEPCHARS, wchBytes, dwSize, (char*)byteASCII, 2, NULL, NULL);<br />
Thanks for any helps in advance...
Cheers...
|
|
|
|
|
I suppose you need to play around with
int isleadbyte(
int c
);
or
IsDBCSLeadByte
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Hi Anthony,
IsDBCSLeadByte(...) is not apply in EBCDIC. EBCDIC uses Shift-Out (0x0E) / Shift-in (0x0F) to identify the start and the end of double byte.
eg. for double byte 0x43 0xA4 it will be
------------------------------------------
| 0x0E | 0x43 | 0xA4 | 0x0F |
------------------------------------------
| Shift In | Byte 1 | Byte 2 | Shift Out |
------------------------------------------
Now, how can I tell MultiByteToWideChar()/WideCharToMultiByte() that both 0x43 and 0xA4 is one single double byte value? Currently MultiByteToWideChar()/WideCharToMultiByte() will treat all of the bytes as single byte value.
Any help is greatly appreciated. I really need help. Please help...
Cheers...
FYI
---
For the code page, I am using:
EBCDIC Japanese code page = 20290
ANSI (Windows) Japanese code page = 932
|
|
|
|
|
I am sure there should exist a Windows API that deal with such situation but I do not know which one is it and how.
If I were you, I will dissect the double byte to byte and further to 4 bits each respectively to do what you want manually. Instead of relying on API. (at least this was what I did for a case I encounter. I don't bother to search on how to use the APIs avail and detail, simply waste more time in my opinion)
A good guide to this that I think would be helpful to you is
http://www.codeproject.com/cpp/endianness.asp[^]
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Hi Anthony,
Thank you for the reply. I think I wasn't clear presenting my question. Currently, when converting single byte EBCDIC, it works fine. In fact, it converts correctly on the single byte EBCDIC. The problem I really facing is when converting 2 bytes at ONE time.
MultiByteToWideChar()/WideCharToMultiByte() converts byte by byte instead of 2 bytes at a time. I am looking at ways to convert 2 bytes at ONE time. Please look at the schema again (sorry if I repeated myself):
--------------------------------------------------------------------
| EBCDIC | ASCII |
--------------------------------------------------------------------
| 0x43 | 0xA3 |
| 0xA4 | 0xCF |
| 0x43 and 0xA4 | 0x83 and 0x7D |
--------------------------------------------------------------------
As you can see if 0x43 and 0xA4 is being converted byte by byte, the result is 0xA3 and 0xCF, however, if 0x43 and 0xA4 is being converted together, the result is 0x83 and 0x7D (this is the correct result. I am expecting 0x8 0x7D).
By the way, I did try to use Big-Endian and Little-Endian, but result is still bad.
Thanks for any help in advance. I am really appreciate your help
Cheers...
|
|
|
|
|
You can use the IsDBCSLeadByteEx(20290, yourByte);
Iterate each one of your bytes.
For normal
0x43 and 0xA4 (means, it is separated), you can just use your
dwSize= MultiByteToWideChar(IBMCodePage , MB_PRECOMPOSED , (const char*)byteEBCDIC, 2, wchBytes, 1024);
For 0x43 and 0xA4 that is meant to be together, by using IsDBCSLeadByteEx to check, you should be able to know if it is or not.
Then, use your own conversion. (means write a special function to deal with such case).
hope this help.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Hi Anthony,
Thanks again for replying. It is greatly appreciated
EBCDIC uses Shift-Out (0x0E) / Shift-in (0x0F) to identify the start and the end of double byte. Therefore, IsDBCSLeadByteEx(...) will not work. eg. In EBCDIC for double byte 0x43 0xA4, the byte sequence will be:
------------------------------------------
| 0x0E | 0x43 | 0xA4 | 0x0F |
------------------------------------------
| Shift Out | Byte 1 | Byte 2 | Shift In |
------------------------------------------
I have tried to use the IsDBCSLeadByteEx(20290, yourByte); and it doesn't work. Therefore, MultiByteToWideChar() will think it is single byte since IsDBCSLeadByteEx(20290, yourByte); will return false.
Any other idea? Please help... I am really despreate. If I can't solve this problem soon, I guess I will use the documentation provided by IBM and do manual mapping.
To all masters... Please help...
Thanks...
|
|
|
|
|
I would like to disable Cut, Copy, and paste into a edit control on a dialog in C++. Can anyone tell me how.
Thank you in advance
Teresa
|
|
|
|
|
try overriding the dialog's PreTranslateMessage() and intercepting the message if it's for the edit control and returning TRUE to indicate it is handled. Otherwise, click on the link below 'My Articles' and have a look at my article 'Lockable Controls' to see how I implemented this in my projects.
My articles
www.stillwaterexpress.com
BlackDice
|
|
|
|
|
By selecting multiple lines of text and hitting the tab key in Visual Studio's text editor, text can be shifted to the right. Is there a way to shift multiple lines of text to the left?
Kevin Shaffer
kshaff03@msn.com
|
|
|
|
|
|
much obliged!
-Kevin
Kevin Shaffer
kshaff03@msn.com
|
|
|
|
|
How about untabify???
I try the menu item, but it doesn't work...
It'd be nice to be able to untab...
It's frustrating being a genius and living the life of a moron!!!
|
|
|
|
|
Hockey wrote:
How about untabify???
Untabify changes all the tabs in the selection to spaces. You have to select text for it to do anything.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
ahhhh...I always wondered what it was doing
Not what I expected it to do...so when I untab and nothing changed...I thought my VS was broken...
It's frustrating being a genius and living the life of a moron!!!
|
|
|
|
|
I try to find sources of any (even the simplest) source colorer add-in for Visual Studio 6.0. Have anybody got samples/links?
Thanks!
|
|
|
|
|
yuri_g wrote:
I try to find sources of any (even the simplest) source colorer add-in for Visual Studio 6.0. Have anybody got samples/links?
Thanks!
Although I don’t think this is exactly what you’re looking for, but VS does offer some basic syntax highlighting beyond the default. I ran across this file quite some time ago.
Create a file called UserType.DAT, place it in C:\Program Files\Microsoft Visual Studio\MSDev98\Bin\
Paste the following text into that file. The text with "%" in front is from the orginal file I found some where on the internet.
%%% steve's datatypes; can be merged with scott wingo's MFC set.
%%% cut and pasted from various win32 header files on a "demand" basis
BOOL
WORD
uint16
uint32
INT
UINT
BYTE
HWND
DWORD
UINT
LONG
VOID
FAR
CONST
PASCAL
CDECL
WINAPI
CALLBACK
WPARAM
LPARAM
LRESULT
PSTR
LPSTR
LPTSTR
LPCSTR
LPCTSTR
PBYTE
LPBYTE
PINT
LPINT
PWORD
LPWORD
PLONG
LPLONG
PDWORD
LPDWORD
LPVOID
LPCVOID
ULONG
USHORT
UCHAR
HANDLE
PHANDLE
SPHANDLE
LPHANDLE
HGLOBAL
HLOCAL
GLOBALHANDLE
LOCALHANDLE
ATOM
FARPROC
NEARPROC
HINSTANCE
HTASK
HGLOBAL
HMODULE
COLORREF
HPALETTE
HPEN
HRGN
HWINSTA
HMENU
HICON
HDESK
HENHMETAFILE
HDC
HCOLORSPACE
HBRUSH
HACCEL
HBITMAP
HCURSOR
HFILE
RECT
LPRECT
LPCRECT
POINT
LPPOINT
SIZE
LPSIZE
WCHAR
LONGLONG
LARGE_INTEGER
ULARGE_INTEGER
GUID
NULL
FALSE
TRUE
INVALID_HANDLE_VALUE
SECURITY_ATTRIBUTES
LPSECURITY_ATTRIBUTES
CRITICAL_SECTION
INVALID_HANDLE_VALUE
HRESULT
SCODE
WAIT_OBJECT_0
WAIT_ABANDONED
WAIT_FAILED
WAIT_TIMEOUT
OVERLAPPED
FILETIME
%%%Borland C++ and Visual C++ have long supported extensible keywords. Below is a data file which contains some of the commonly used Win32 datatypes. This makes is easier to recognise mistyped values without having to wait for the compiler to tell you off.
%%%Download the file and place it in the BIN directory of the IDE. Then restart MSDEV and enjoy more color coded text. Note that a lot of the Win32 data types are still missing -this set covers the ones we commonly use. But it's a start -on a big project adding in your own classes is the next big step.
%%%Scott "MFC FAQ" Wingo has a usertype.dat file which covers many C++ classes: if you merge that one with ours then you get the best of both worlds. However, this file seems to have dropped off the web site and isn't in the Program VC++ 5th edition CD either. Someone will have to do a new version of the file
Social Engineering Specialist.
Because there is no patch for human stupidity.
|
|
|
|
|
Hi all,
I've got a binary file which I need to read into my application, the file contains numeric data as well as strings (each one is seperated by a comma). The problem I've got is that the string data is of a variable length so I can't just grab 100 chracters.
As such I'm going through the file a character at a time, where I have string data I have a while loop which goes round until I find a comma, I then put the completed string into a member variable and then start on the next line. When I get to the numeric data instead of doing the above I just do:
ifs >> myDouble ; //ifs is ifstream
however this does not convert the data into numeric format as it always sets myDouble to 0, and when I then next go into a while loop to build up a string it never reads in a character and ends up as an infinite loop.
Does anyone know how I can solve this problem?
cheers,
Andy
|
|
|
|
|
I had this same problem about five years ago where the original application would read in a character at a time from a file. If the file was 1MB in size, that's theoretically around 1 million disk reads. The items in the file were formatted as a number followed by a number followed by a \0 terminated string. The files were huge so a day to process them was not uncommon. I cut the processing down to a matter of minutes by using CMemFile and more intelligently processing the buffer. I read the two numbers using two read statements, and then knowing that the \0 terminated string could be no longer than, say, 200 bytes, I read the next 201 bytes into a buffer. I then searched that buffer using CString::Find() for the terminating \0 character. The next read statement started from the next character following.
Knowing how slow that application could be, the first few times I tried my version, I was not convinced it worked. When I passed it around to a few others, they were amazed at how fast it was.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|