|
If the file is written out such that each vertex is written as float1float2float3, then writing out a series of vertices would just mean you would have vertex1vertex2vertex3... where each vertex matched the pervious pattern. Thus, you could read them in in such a fashion (though, I would still stick with using the copy algorithm).
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Hi!
Can anyone tell me how to enumerate the USB Hubs connected to my PC?
In theory (i think) it should work like this:
hDevInfo = SetupDiGetClassDevs(GUID_DEVINTERFACE_USB_HUB, NULL, NULL, DIGCF_DEVICEINTERFACE | DIGCF_PRESENT);
...and give me a list of the hubs. Using GUID_DEVINTERFACE_DISK as GUID works perfect for harddisks but when i try to use GUIDs from the usbiodef.h nothing is found.
Can i use my VS.NET 2002 for this or does it only work with the c Compiler from the DDK?
|
|
|
|
|
u can search in registrey . the ddk has a sample in it . name of that sample is usbview. just check it out.
If u can Dream... U can do it
|
|
|
|
|
Hello there. I need help with a simple MFC program, it needs to move the mouse to a specific point on the window. Is there a function that can move the mouse to a coordinate?
thanx..
KOM UIT DAAAAA!!!
|
|
|
|
|
You can use the SendInput function to move the mouse to any place on the screen. When using the function notice that the screen coordinates(resolution) have to be converted to mouse coordinates(0-65535) in both the horizontal and vertical directions.
Chipper Martin
|
|
|
|
|
What are the other parameters the SendInput function takes?
KOM UIT DAAAAA!!!
|
|
|
|
|
Click on this link and it will lead you to the direct microsoft information for SendInput
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/userinput/keyboardinput/keyboardinputreference/keyboardinputfunctions/sendinput.asp
Chipper Martin
|
|
|
|
|
SetCursorPos()
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
I'm working on a program that tracks my stats as I'm playing online poker. The stats portion if working fine, now I want it to display bitmaps of my chosing on top of the poker window as I'm playing. I can get a handle to the window using FindWindow... is it possible to display the bitmap in the poker window using this somehow? If so, would it just be overwritten by the actual poker app as it also displays it's graphical info to the same window?
Any other ideas?
Thanks!
|
|
|
|
|
Once you use FindWindow to locate the correct hwnd for the poker window, you're most of the way home. Rather than trying to paint your bitmap in the DC for that window, which could very well run into the kinds of problems that you anticipate, consider instead creating a new child window using the poker hwnd as the parent. That way you'll have complete control and can paint what you want in your child window without worrying about what the poker app will paint. You can set yours to be a floating window or any number of other options, but I think this approach will give you the most flexibility.
|
|
|
|
|
|
It may not be the approach they took since it's their app and they have control over who paints to the DC and when. However, if you want to superimpose your images over theirs and try to simply paint on their DC, you may find your work being overwritten by theirs since you have no way of determining exactly when and where they paint things.
You might try experimenting with both approaches and see what works best for you.
|
|
|
|
|
Hello,
have someone any Idea how to spy mousebutton clicks (No, not the normal buttons, one of the extended buttons, my mouse have 7 of them) with LibUsb http://libusb-win32.sourceforge.net/ , maybe with some example code snippets ?
I have only found:
-some Linux code for the "kernel"
-some Dos/command line based apps.
But i found no trick to use it in a windows application, neither it do nothing or the mouse "hang" because all the data are not pass through the mouse driver.
regards
Peter
|
|
|
|
|
--------------------------------------------------------------------------------
Hi!
I'm doing an application where I have to place wrapping text inside boxes.
It's an MFC single document view.
The problem starts when I zoom out or in:
CSize size = pDC->GetTextExtent(str);
size.cx will have different values depending on the zoom level.
I've read the documentation and GetTextExtent() it's suppose to work on Logical units, so I don't understand what is going on.
That's a big problem because I do the wrapping myself (i have rotated text) and the wrapping changes when zooming.
Help please!!! I've been working on this 3 days now!!
|
|
|
|
|
what do u mean zoom in/out?
e.g. original font height is 8, when zoon in as 50%, u set font height as 4?
|
|
|
|
|
includeh10 wrote: e.g. original font height is 8, when zoon in as 50%, u set font height as 4?
When you zoom in, fonts get bigger. So if you zoomed in by 50%, the font size would be 12. If you zoomed in by 100%, the font size would be 16.
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
No. What I meant is that for a fixed fontsize, I get different results depending on the Viewport size.
CreateFont();
pDC->SelectObject(&m_Font);
CSize StrSize = pDC->GetTextExtent("helloamigo") ;
If I do this on MapMode MM_ANISOTROPIC, when I zoom in and out, changing the SetViewportExt I got different StrSize values.
Funny thing is that according to the documentation GetTextExtent should return values in logical units... but it seems to change depending on DC mapping mode.
That makes the wrapping to change depending on zoom values.
|
|
|
|
|
I solution I have found:
When creating the font with CreateFont use a NEGATIVE size (nHeight).
"< 0 The font mapper transforms this value into device units and matches its absolute value against the character height of the available fonts. "
I'm still having problems but I think they are less obvious now.
|
|
|
|
|
I want to limit print contents (bitmaps, texts and lines) inside a rectangle, any parts of print contents out of the rectagle will not be printed.
the function SelectClipRgn(...) works fine for screen DC, but doesn't work for print DC in MM_LOENGLISH mode.
ant suggestion to help?
|
|
|
|
|
The last time I worked with printing stuff, the first thing I did was look at the MFC code that's used for standard apps in OnPreparePrinting, etc. (You can find out which MFC source code files to look at by stepping into these functions in your debugger and simply noting which files they are.)
I think you'll find a fair amount of useful example code there. Take a look at what they're doing for the print preview stuff as well.
|
|
|
|
|
|
I have a DLL decalred as follows:
#ifdef DLLDIR_EX<br />
#define DLLDIR __declspec(dllexport)<br />
#else<br />
#define DLLDIR __declspec(dllimport)<br />
#endif<br />
<br />
extern "C"<br />
{<br />
<br />
int DLLDIR DLLFunc2(int);<br />
void DLLDIR DrawEllipse(CRect, CDC*);<br />
<br />
};<br />
<br />
extern int DLLDIR DLLArg;<br />
<br />
class DLLDIR DLLClass<br />
{<br />
<br />
public:<br />
DLLClass();<br />
~DLLClass();<br />
<br />
int Add(int, int);<br />
int Sub(int, int);<br />
int Identify(void);<br />
<br />
<br />
int Arg;<br />
<br />
};
I can access my DLL functions using LoadLibrary and GetProcAddress but how would I gain access to the DLL class using the same procedure?
Thanks.
|
|
|
|
|
You can't. You need to use implicit linking if you want to import classes (that is, you need to link to the library which is associated with the dll and not using LoadLibrary).
|
|
|
|
|
hey fellow cpians,
I am using std::ofstream to write data to a log file.. What i would like to do is monitor the size of the file and when it reaches a certain size close the file and reopen another one with an appropriate time stamp
i have a localised function which writes to the file. The name of the funcion is writeToLog( std::string s) . Every time the function is called with a new string i would like to check the size of the file before writing the string out. if the file size is 2Mb then i would close the file and reopen a new file with a new name.
My problem, however is that i do not know how to check the size of the open file using STL.
can anyone help.
thankyou.
|
|
|
|
|
flippydeflippydebop wrote: My problem, however is that i do not know how to check the size of the open file using STL.
Use seekg(0, ios::end) followed by tellg() .
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|