|
Aqiruse wrote:
Nothing is impossible, It's merely a question of figuring out HOW?
It's more a question of why. Why not have the the dll render into/onto a bitmap which then is displayed by your application? Much more sane and easy.
Joel Lucsy (jjlucsy@concentric.net)
|
|
|
|
|
Aqiruse wrote:
Then when this window needs updating, I will call Render(...,...) and pass in the required parameters.
Why don't you make one of the required parameters for your Render(...,...) method be the HWND to the static box(or CWnd* if you are using MFC), or a memory device context? Maybe even a pointer to a bitmap which you have preacllocated. In your static box's WM_PAINT handler, just call the dll's Render function. Done.
|
|
|
|
|
Invisible window doesn't get WM_PAINT messages, what you want to redirect?
|
|
|
|
|
I know how to activate a dial-up modem connection to the Internet using WinInet (see my article on MSDN about it), but how do I show the dialog box
This is the one that pops up after you open IE, it dials in automatically for you, and then when you close IE, the dialog above shows. What API do I call for that, or do you think it's an IE thing?
Thanks.
Sincerely Yours,
Brian Hart
"And that's the news from Lake Wobegon, where all the women are strong, the men are good-looking, and the children are above-average." - Garrison Keillor
|
|
|
|
|
|
Hi.
I am stuck with an intesting problem with the string library. Let say declare a string (empty). To start out, I append a statement. Afterward, I want to append an integer and end it with a char. For example:
string strTemp;
for (int i = 0; i < 5; ++i)
{
strTemp += "Count down: ";
strTemp += i; // Problem!
strTemp += '...";
cout << strTemp.c_str() << endl;
}
The output of the code above will looking something like:
Cout download: *character that 0 represents*
Cout download: *character that 1 represents*
Cout download: *character that 2 represents*
Cout download: *character that 3 represents*
Cout download: *character that 4 represents*
The output I want is:
Cout download: 0
Cout download: 1
Cout download: 2
Cout download: 3
Cout download: 4
Is there a way to append or concatenate an integer into a string variable and have the string variable store the integer as an integer instead of the ACSII character the integer represents?
Thanks,
Kuphryn
P.S. I experience the same problem with STL container. Furthermore, the problem remains even if I switch from a string to a vector<int>. It seems the two do not mix.
|
|
|
|
|
Use a stringstream:
#include <sstream>
stringstream strm;
strm << "Count down: " << i << "other stuff" << ends;
cout << strm.str().c_str() << endl;
--Mike--
My really out-of-date homepage
"Why does anyone have a web page? Too much free time... not enough friends... justifying owning a computer." -- Noel Crane on Felicity
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan.
|
|
|
|
|
Nice!!!
Someone posted about ostringstream at Arc Technica. ostringstream works great.
What is the difference between:
- stringstream
- ostringstream
- istringstream
Kuphryn
|
|
|
|
|
Why does this code work?:
char test[12], test1[12];
....more code...
fscanf(fp,"%d %s %s %s %s",&hour,station,country,test,test1);
And this doesn`t:
CString test, test1;
....more code...
fscanf(fp,"%d %s %s %s %s",&hour,station,country,test,test1);
The CString values are correct just after the 'fscanf', but they disappear after some other function calls.
|
|
|
|
|
You are directly modifying the contents of the CString without locking the buffer first.
CString test, test1;
LPTSTR pszBuff, pszBuff1;
pszBuff = test.GetBuffer(12);
pszBuff1 = test1.GetBuffer(12); Now you can use pszBuff/pszBuff1 in fscanf(). Call ReleaseBuffer() on both CStrings once you're done directly modifying the contents.
--Mike--
My really out-of-date homepage
"Why does anyone have a web page? Too much free time... not enough friends... justifying owning a computer." -- Noel Crane on Felicity
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan.
|
|
|
|
|
Thank you, so much. And then if I modify the values in many places, this way: if (...) test="some word", and so on... What must I do? Have I to make a GetBuffer before modifying it and ReleaseBuffer after each one?
|
|
|
|
|
José Luis Sogorb wrote:
Have I to make a GetBuffer before modifying it and ReleaseBuffer after each one?
Yep. See the docs on CString::GetBuffer() for some examples.
--Mike--
My really out-of-date homepage
"Why does anyone have a web page? Too much free time... not enough friends... justifying owning a computer." -- Noel Crane on Felicity
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan.
|
|
|
|
|
Hi all,
Please introduce to me all functions or classes in C++ or VC++ about sending or reciving bits to special address in LPT port !
Please help me
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I am using an owner draw ListView and I have a need to display the vertical and horizontal scrollbars at all times. I've tried passing the WS_HSCROLL and WS_VSCROLL style bits to CWnd::CreateEx, but to no avail. I have been able to get the desired result by setting the control's style in response to a WM_SIZE message, however this is very inefficent.
Does anybody know a more direct way of always displaying the scrolls in a ListView?
|
|
|
|
|
maybe you should set the range
one is the other who absorbs the thoughts of others
|
|
|
|
|
is it possible to download an add on to VC++ 6 that allows building of Linux/KDE programs? And are there any tutorials on the subject.
I am trying to create Linux counterparts for my windows MFC software.
Please help.
Jonny
.NET or not .NET? Bill has the answer......
|
|
|
|
|
|
Hi all
How to update my desktop ?
In API Windows
I use
HWND hwnd;
hwnd = GetDesktopWindow();
UpdateWindow(hwnd);
but nothing append
Can u help me please...
Thank u all
Leedoriden ( FR )
|
|
|
|
|
UpdateWindow() will repaint the parts of a window that are marked invalid (i.e. in need of repainting). You should first call Invalidate() to invalidate the desktop.
There's no need to call UpdateWindow(), since Windows will eventually send a WM_PAINT message to the desktop. However, if you want to force an immediate repaint, then call UpdateWindow() right after you call Invalidate().
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hello!
I want to establish data sessions between 1 server and n-clients. The data communication would be progressing between 1 server and n-clients simultaneously.
i.e.one server and many clients.i.e. N client machines would be connecting and communicating with 1 server machine. Once the connection is established, server would be accepting the data sent by the clients and then the same data would be again sent back to the same client who sent it to the server, through modem. The application should have the capability to do data transmission and receive simulnateously with n-clients.
The application is supposed to run on Win 98,WinNT, WIN 2000 and Win XP. I am using C programming and TAPI 2.0. I do not want to use COM/DCOM. Can you please tell me if it is possible to build an application of n-clients and 1 server using language C, TAPI 2.0 and without COM/DCOM.
I already have built an application for data communication between single client and single server.
Data transmission is done through the COM port to which the modem is connected.
While programming for 1-server 1 client I have made use of async comm by using CreateEvent(), ReadFile(), WriteFile() (for communciation between COM ports), WaitforSingleObject() and GetOverlappedResult().
The configuration I am using is :
There is a modem connected to the server machine and there are n (say 4) client machines. Each client has a modem connected to it. The data communication is via the modem through the COM port to send and recieve data (data communication--> client to server back to client).
If suppose, the server is waiting for connection and a client connects to the server, the connection is established and the data communication is started. Now another client attempts to connect to the server, will that client be able to connect to server ?? (as the first client is still holding the line and busy in data communication).
Do I have to have some other specialised hardware so that other clients may also connect to server simultaneously. (same as in EPBX systems).
or do I need to have some software which will help me connect n-clients to 1 server.
Could you please guide me amd give some idea about how to go about solving this problem.
Your advise would be of great help to me.
Thanking you.
With Regards,
Sandeep Shetty
|
|
|
|
|
Hello All,
Anyone with a nice algorithm to randomly generate points in a polygon? Random points based on the bounding boxes are not working nicely.
Any help or tip?
Best regards,
Paul.
Paul Selormey, Bsc (Elect Eng), MSc (Mobile Communication) is currently Windows open source developer in Japan, and open for programming contract anywhere!
|
|
|
|
|
You mean you want to generate random points which are within the polygon ?
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Yes. I have the coordinates of the polygon and I need to be able to randomly select a given number of points from within the polygon. The aim is to draw dots in the polygon randomly, something to show low and high density polygons.
Best regards,
Paul.
Paul Selormey, Bsc (Elect Eng), MSc (Mobile Communication) is currently Windows open source developer in Japan, and open for programming contract anywhere!
|
|
|
|
|
Two ways you could do this:
1. Generate a mask bitmap. Make it black and draw a filled polygon in white. Then for each point you generate, check if that pixel in the mask is white
2. To find out if a point is inside the polygon, use the ratio of x2-x1/y2-y1 to find out the slope of each line. Then use that ratio to figure out if that point is inside that line, or not.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Hello Christian,
Thanks for the suggestions. Currently, I am doing this
1. Get the bounding box of the polygon and use it to generate the random points.
2. Create a region CRgn out of the polygon and test if the point lies in the region PtInRegion, if not generate another till I get the required number of points.
The application, however, requires a lot of speed and it deals with many polygons. I will try your suggestions too to see which is faster and less memory consuming.
Best regards,
Paul.
Paul Selormey, Bsc (Elect Eng), MSc (Mobile Communication) is currently Windows open source developer in Japan, and open for programming contract anywhere!
|
|
|
|