|
|
Well, here is evening...Drugz?
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]
|
|
|
|
|
Whatever it takes, man
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Did you read the function documentation ? This is done by default:
First, the key is looked up. If the key is found, then the corresponding value is changed; otherwise a new key-value pair is created.
|
|
|
|
|
Cedric Moonen wrote: Did you read the function documentation ?
Doubtful.
|
|
|
|
|
Dhiraj kumar Saini wrote: Now what i want is that if the data with some key exist and u are having some new data for the same key then the original data should be replaced with trhe new data in the CMap
yes, that's how a map is supposed to work.
so what's your problem ? did you try anything before asking for help ?
|
|
|
|
|
Hi masters!
-----------
I'm writing a system-wide keyboard hook. I've an EXE that calls a function
named "InstallHook()" from a DLL, passing it's current thread ID through it
(say dwThreadID) ...
Within DLL, I've a general variable named g_dwThreadID that will be equal to
dwThreadID (mentioned above) ...
The problem is:
----------------------
Although g_dwThreadID has a certain value within the DLL initializely,
but it will be equal to zero! I guss It's because the DLL is mapped to every
proccess in the system and then all variables, including g_dwThreadID gets
initialized ...
Now I'm looking for a way that I can share initialized g_dwThreadID among
all loaded instaneces of my DLL ...
Any help?
|
|
|
|
|
See, for instance, here.
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]
|
|
|
|
|
Thank you cPallini!
I wish I know programming as much as you
|
|
|
|
|
Well, I actually used Google.
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]
|
|
|
|
|
Hello I need an help , is there any article in codeproject that could help me to write a program for detecting the edge of a black white bitmap and convert it to line ?
Thank
|
|
|
|
|
Regards,
Sandip.
|
|
|
|
|
Hi
I try to explain better the problem.
I have a black and white bitmap , and I found algorithm to detect the edge between the 2 color ( Sobel algorithms ). Now I have a list of pixel that describe the border ( edge ) of the image and I need an algorithm to approximate the list of point with a set of lines.
At the end I need an algorithm to convert a Bitmap file to a Plot file , or better I need to convert a Bitmap to a CAD/CAM path description of a cutter.
Thank
|
|
|
|
|
What about CodeProject's article search engine
[^]?
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]
|
|
|
|
|
Hi
I try to explain better the problem.
I have a black and white bitmap , and I found algorithm to detect the edge between the 2 color ( Sobel algorithms ). Now I have a list of pixel that describe the border ( edge ) of the image and I need an algorithm to approximate the list of point with a set of lines.
At the end I need an algorithm to convert a Bitmap file to a Plot file , or better I need to convert a Bitmap to a CAD/CAM path description of a cutter.
Thank you very much
|
|
|
|
|
I have an issue when computing how long a Unicode string is when it is actually displayed on screen. For example, you might have a 30 character Thai string, but when it is actually displayed, some pairs of characters result in a single character on-screen, so the result might only 'look' like 20 characters. What seems to happen is that two characters sometimes result in a character with a 'mark' above it (like a European accent character).
Because of these potential pairs, logic I have that currently uses _tcslen goes out of the window. I tried experimenting with the GetCharacterPlacement API call but didn't get very far. The strings all display correctly, but I have to know the 'display length' when forcing a fixed number of characters-per-inch (don't ask!).
Is there a way to find this out?
|
|
|
|
|
GetTextExtentPoint32
The GetTextExtentPoint32 function computes the width and height of the specified string of text.
BOOL GetTextExtentPoint32(
HDC hdc, // handle to device context
LPCTSTR lpString, // pointer to text string
int cbString, // number of characters in string
LPSIZE lpSize // pointer to structure for string size
);
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
I know how to get the length in pixels - what I need is the count of characters that will be displayed... which might be different to the string length...
|
|
|
|
|
Perhaps the ::GetTextExtentExPointI()[^] function is what you're looking for...
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
A hidden Unicode-enabled (Rich)Edit control?
Stuff the text into it and then ask it for its length? Kludgy, and definitely brute-force, but it should work...
Peace!
-=- James Please rate this message - let me know if I helped or not!<hr></hr> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
The notion of a "character" does not make sense in all languages. What a "wide-char" character contains is a Unicode code point, and as you found out multiple code points can (and do) form a single glyph on screen.
See if the Grapheme Cluster Boundaries[^] chapter from Unicode standard is of any help. I am not aware of any Win32 API that would help you directly.
|
|
|
|
|
hello all:
now i have got some troubles,I wrote a program .it was run under the unix or linux
in the program i first creat a socket and start to listen, when a connection comes ,my socket will catch it ,then i check if the connection's ip address was allowed ,if it was not in my ip table,i will refuse the connection ,if the ip address was in my ip table i will fork a child thread and exec a telnetd process then the child process give the socket connection to the telnetd process .and the telnetd process will take the child process position
but i dont konw how can i start the telnetd process
i tried ,but telnetd give met "on non-socket" error
can sb show me code snippet,thankfulness!
a beginner
|
|
|
|
|
alphaxz wrote: but i dont konw how can i start the telnetd process...
If it is a separate program, see here.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
i m trying to convert string into unicode using following method is that correct way ?
char *ansistr = "Hello";
int lenA = lstrlenA(ansistr);
int lenW;
BSTR unicodestr;
lenW = ::MultiByteToWideChar(CP_ACP, 0, ansistr, lenA, 0, 0);
if (lenW > 0)
{
unicodestr = ::SysAllocStringLen(0, lenW);
::MultiByteToWideChar(CP_ACP, 0, ansistr, lenA, unicodestr, lenW);
}
else
{
MessageBox("String Lenght should be greater than Zero");
}
::SysFreeString(unicodestr);
when debug variable unicodestr carry value 61453 after calling MultiByteToWideChar(CP_ACP, 0, ansistr, lenA, unicodestr, lenW);
In end it changes for 61453 to 72.
which one is unicode of "Hello"
and how can i checkit and get string back from unicode????
|
|
|
|
|