|
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();
|
|
|
|
|
Win98 doesn't have an MSGINA.DLL though does it?
|
|
|
|
|
Replacement of MSGINA.DLL is only needed for disabling Strg+Alt+Entf. All other key events can be handled by hooks.
Alexinuk wrote:
Win98 doesn't have an MSGINA.DLL though does it?
Well I think it's only provided for WinNT and higher
|
|
|
|
|
Alexinuk wrote:
Is this the only way
I don't know if it's the only one, but it should be the best! You could possibly write you own keyboard driver - but that won't be easier. And system-wide hooks (that one's inside DLLs) even work for catching all input.
Alexinuk wrote:
will this work on all windows (95/98/....etc)?
Sure - do you expect anything else from MS?
|
|
|
|
|
i get:
<br />
SimpleServer.obj : error LNK2001: unresolved external symbol __imp__WSACleanup@0<br />
SimpleServer.obj : error LNK2001: unresolved external symbol __imp__closesocket@4<br />
SimpleServer.obj : error LNK2001: unresolved external symbol __imp__send@16<br />
SimpleServer.obj : error LNK2001: unresolved external symbol __imp__inet_ntoa@4<br />
SimpleServer.obj : error LNK2001: unresolved external symbol __imp__accept@12<br />
SimpleServer.obj : error LNK2001: unresolved external symbol __imp__bind@12<br />
SimpleServer.obj : error LNK2001: unresolved external symbol __imp__htons@4<br />
SimpleServer.obj : error LNK2001: unresolved external symbol __imp__WSAStartup@8<br />
wenn i start my programm, here is my programm:
<small><br />
#include winsock2.h<br />
bool ServerStart;<br />
<br />
......<br />
<br />
......<br />
<br />
UINT ServerThread(LPVOID Param)<br />
{<br />
SOCKET server;<br />
WSADATA wsaData;<br />
sockaddr_in local;<br />
ServerStart = TRUE;<br />
int wsaret = WSAStartup(0x101, &wsaData);<br />
<br />
if (wsaret != 0)<br />
{<br />
return 0;<br />
}<br />
local.sin_family = AF_INET;<br />
local.sin_addr.s_addr = INADDR_ANY;<br />
local.sin_port = htons((u_short)20248);<br />
<br />
if (bind(server, (sockaddr*)&local, sizeof(local)) != 0)<br />
{<br />
return 0;<br />
}<br />
SOCKET client;<br />
sockaddr_in from;<br />
int fromlen = sizeof(from);<br />
<br />
while(ServerStart == TRUE)<br />
{<br />
char temp[512];<br />
client = accept(server, (struct sockaddr*)&from, &fromlen);<br />
sprintf(temp, "Your IP is %s\r\n", inet_ntoa(from.sin_addr));<br />
send (client, temp, strlen(temp), 0);<br />
closesocket(client);<br />
}<br />
closesocket(server);<br />
WSACleanup();<br />
return 0;<br />
}<br />
</small>
|
|
|
|
|
i already found the solution, i had to link my compiler with the file: ws2_32.lib
didn't pay attention...
thnx anyways
|
|
|
|
|
Have you tried WM_SETREDRAW (MFC: CWnd::SetRedraw)? IIRC it can make a significant difference.
|
|
|
|
|
i've done some basic socket programming so far and there's one thing i'm unable to explain. it works, but i don't know why.
i'm sitting behind a proxy-server here and when i write a program using sockets, i just use the usual socket-functions provided by the socket-api.
my program works fine here behind the proxy and without any changes at other locations, where there is no proxy.
why?
other programs like browsers, winamp and the like have an extra proxy-settings dialog and in fact they're unable to connect to the internet, when i don't specify one there.
can someone explain that to me, please...
:wq
|
|
|
|
|
Need more information about what you are connecting to.
"No matter where you go, there your are..." - Buckaoo Banzi
<pete>
|
|
|
|