|
strInsert is a std::string, szName is const char* and strValue is a std::string.
strInsert = "<";
strInsert += szName;
strInsert += ">";
strInsert += strValue;
strInsert += "\r\n";
Can anyone tell me if the above commented line f***s up the string?
The string looks like this before the commented line:
<hejsan>yahyah</
|
|
|
|
|
Verifier wrote:
strInsert += "strInsert += szName;
HUmm .. is that really what you wrote in your code ?
~RaGE();
|
|
|
|
|
nope. this is what i wrote:
strInsert = "<";
strInsert += szName;
strInsert += ">";
strInsert += strValue;
strInsert += "</";
strInsert += szName; //this line f***sup the whole string
strInsert += ">\r\n";
Can anyone tell me if the above commented line f***s up the string?
The string looks like this before the commented line:
<hejsan>yah</
And after it:
8Hsan>yah</
|
|
|
|
|
You could try
std::string strName(szName);
before your code snippet, and then only append strName.
But honestly, I have no idea what is happening to your string. You really should be able to use it this way.
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
Verifier wrote:
Can anyone tell me if the above commented line f***s up the string?
From what you displayed; yes it does.
Let me guess, you're using VC7 and got those results from watching the string in the debugger, not from really outputing it to the console (or something similar)?
Check the implementation of basic_string and you'll see what causes this (you might also want to search some MS NG's and see you're far from alone in having been bitten by this). An MS dude wrote some code (a debugger extension) to handle this. Should be available from the public.vc.lang NG archives.
|
|
|
|
|
Mike Nordell wrote:
Let me guess, you're using VC7 and got those results from watching the string in the debugger, not from really outputing it to the console (or something similar)?
yep. I printed out the text and it was correct.
thanks!
|
|
|
|
|
I want to use the slider control with a smaller thumb size.
I have checked all the examples of slider control, but could not find a direct way to do it.
(All the custom slider controls handle mouse events so that they can have a custom sized thumb. But I dont want to do it this way.)
Is there any direct way to achieve this, something like handling WM_MEASUREITEM. (This message is not sent for sliders )
Also is it possible to set the size of background line of slider control too?
Experts help me..
|
|
|
|
|
I need to start and stop the tomcat server using the vc++ program.Iam new to the networking concepts.I would like to know how I can do this task.lets say the server is listening as a localhost server.
Awaiting eagerly for your messages
thanking you
venki
|
|
|
|
|
Any ideas howto simulate connection which made up by RasDial()?
In order to debug my app, I've to connect & disconnect the internet every few seconds . Dya know a faster way to simulate this kind of connetion <dialup, not="" vpn="">.
Jee... thanX
--BlackSmith--
/*The roof is on fire, we don't need no water, let the MF burn*/. BHG.
|
|
|
|
|
Any ideas howto simulate connection whick made up by RasDial()?
In order to debug my app, I've to connect & disconnect the internet every few seconds . Dya know a faster way to simulate this kind of connetion <dialup, not="" vpn="">.
Jee... thanX
--BlackSmith--
/*The roof is on fire, we don't need no water, let the MF burn*/. BHG.
|
|
|
|
|
Hi frineds,
I am having a bitmap with 1280 x 1024 resolution. When I call this bmp in my program I am loosing some information because my display resolution is 1024 x 768. I want to fit this bmp into my window without loosing any information. How to do that ?? Can anybody suggest some methods??
Thanks
Satya
|
|
|
|
|
SatyaDY wrote:
I am having a bitmap with 1280 x 1024 resolution. ... my display resolution is 1024 x 768. I want to fit this bmp into my window without loosing any information. How to do that ?? (emphasis added)
What you say you want is impossible. You can't fit a bmp onto a smaller bmp without loosing information.
You have two choices: Either StretchBlt (or any other, high quality, means of resizing it) and loose information, or create a scrollable window so the user can display only a subset of the full bitmap.
|
|
|
|
|
Hi Mike,
With StretchBlt will I loose any information ?? One more doubt I want to get the coordinates of the bmp after using StretchBlt. Can I get those details ??
Regards,
Satya
|
|
|
|
|
SatyaDY wrote:
With StretchBlt will I loose any information??
As I already told; yes, of course you will. As soon as you resize an image (to a smaller size) you obviously will loose information. There simply is no way you can fit 200 bananas in a box made for only 150 without either crushing them or throwing away 50. The same goes for pixels.
One more doubt I want to get the coordinates of the bmp after using StretchBlt. Can I get those details ??
Sorry, I don't understand your question. What coordinates? A bitmap contains no coordinates, it contains pixels.
As for scaling a position from the src bmp to the dest bmp:
new_x = old_pos.x / old_size.x * new_size.x;
The same goes for y. It might help if you think of it as percentage of size instead of pixel positions, and all should be clear (i.e. a pixel 75% of the bitmap width from the left of the large bitmap is, however you scale it, still 75% of the scaled bitmap width from the left).
|
|
|
|
|
Sorry,
I didn't put it correctly. Supposing that I have the India map (bmp) and Delhi as my reference point, I will get some x and y on 1280 x 1024 display.
Now I have used StretchBlt function and converted this to fit 1024 x 768,Now I want the pixel position. With your calculation ur calculation I am getting the floating values. How to get the exact values on the display. Thanks for the replies Mike.
Satya
|
|
|
|
|
SatyaDY wrote:
With your calculation ur calculation I am getting the floating values. How to get the exact values on the display.
I don't know what an "ur calculation" is (Abacus related? ;->), but for your question; either truncate to integer or round as you see fit. Again; if source bmp is 1280x1024 and dest bmp is 1024x768, and a point in the source bmp happens to be at coordinate (500,700), then
x_offs_percent = float(500)/1280;
y_offs_percent = float(700)/1024;
x_offs_in_dest_coord = x_offs_percent * 1024;
y_offs_in_dest_coord = y_offs_percent * 768;
If you don't want to use floating point, just turn the operations around to be:
new_x_offs = orig_x_offs * 1024 /1280;
|
|
|
|
|
Thanx Mike,
I got it.
Satya
|
|
|
|
|
I've created an application which automates excel 97 (thanks to the help of the microsoft supports articles Q178749, for example).
As i want to automate excel, with office 97, i need of the following library Excel8.olb. So, in my project I would fill some range in an excel worksheet, to do it i use the function setvalue, which takes (with office 97) only one parameter, a COleVariant; but now here is my problem, when i try to do the same thing with office XP( i've seen that i have to replace excel8.olb, by excel.exe) the same function need of 2 input parameters, now!!!
Setvalue(COleVariant, COleVariant). One of this parameter is naturally the same that hte one i've used with excel 97, but the second one, i don't what i ve to put!
I'm sorry of my approximating english, but if someone could understand me and help me to solve this problem, he will be really great
thanks in advance for your help
Gerald
|
|
|
|
|
Well, I think with start of Office XP you've to call SetValue2(COleVariant). That should work.
|
|
|
|
|
ok i will try, and i'll tell you if it works
thanks a lot
|
|
|
|
|
sorry to be late to answer you. Just to tell you that your solution works, thanks a lot
|
|
|
|
|
If anyone can help with the following i'll be eternally grateful...
One of the requirements of a project i'm working on is that users of this app are unable to access windows - i.e. when the computer is powered, windows loads, then our app. users shut their computer down from within the app, and must be unable to access windows with CTRL+ALT+DELETE, ALT+F4, ALT+TAB etc.
I know that you can do this for 95/98 and ME by using some screensaver API calls, but apparently this won't work for all windows versions.
any ideas?
Thanks in advance,
Alex
|
|
|
|
|
All key combinations (apart form Strg+Alt+Entf - here you'll need to replace MSGINA.DLL) can be handled and thus permitted by installing a windows hook. To get it work for your whole windows sessin, place the hook procedure inside a DLL. You'll find many informations about that in MSDN - try searching for SetWindowsHookEx.
|
|
|
|
|
Cheers Mate.
Is this the only way? will this work on all windows (95/98/....etc)?
Regards,
Alex
|
|
|
|
|
Alexinuk wrote:
will this work on all windows (95/98/....etc)?
Yes. Use the WindowsHookEx for the latest versions, or WindowsHook for backward compatibility.
Alexinuk wrote:
Is this the only way?
Yes.
~RaGE();
|
|
|
|