|
your suggestion equals zero.
includeh10
|
|
|
|
|
includeh10 wrote: do you have any idea to solve the problem?
Two different options the way I see it,
Create a client server environment, or use a web form to interact with the database. Your app could fill in the web form and submit it to the db.
ZeePain! wrote: This seems like one of those programs that started small, grew incrementally, building internal pressure, and finally barfed all over its source code sneakers. Or something.
thedailywtf.com[^]
|
|
|
|
|
Hey,
I'd like to draw a line while the mouse is moving (like CRectTracker). How can I do this?
I tried to draw the line in OnMouseMove and call InvalidateRect() but then the screen flickers...
|
|
|
|
|
One golden rule in windows drawing is that NOTHING is stored when you draw something on your window !! So, when you call InvalidateRect, it will repaint your window and thus erase what you did. This is something really important and you have to remember whenever you want to make drawings on a window.
Now, the way to 'solve the problem': when you should normally draw your line (in your case, probably in OnMouseMove), instead of directly drawing on the screen, save in your class what need to be drawn (the coordinates of the start and end points of your line). Then call Invalidate. This will result in calling (indirectly) the OnPaint function. In this function, you will do the drawing ! So, like that, even when your windows is repainted due to external events (when your window has been hidden and then visible again for exemple), your data drawn on screen won't be lost but redrawn again each time instead.
Hope this is clear
|
|
|
|
|
How to save the coordinates in the class ,i did not get that?
I am having a same problem
|
|
|
|
|
Use SetROP2(R2_XORPEN) so that redrawing the line in the same spot twice causes the line to be erased. I use a seperate function for this
void CMyWnd::DrawLine(CPoint Start, CPoint End)
{
CClientDC DC(this);
int s = DC.SaveDC();
DC.SelectObject(GetStockObject(WHITE_PEN));
DC.SetROP2(R2_XORPEN);
DC.MoveTo(Start);
DC.LineTo(End);
DC.RestoreDC(s);
} Using a white pen causes the line to be drawn using the inverse screen colour. Redrawing the same line again causes the colours to be inversed again resulting in the original colour, or the line being erased.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
"holder = GetProcAddress(library,_T("Build"));
mention the function ordinal in place of _T("Build")" - sunit5
Ok so I'm still having problems but I think sunit may have solved them. I just don't know how to pass the ordinal value using LPCSTR so that GetProcAddress will understand what I'm even talking about. Thank you in advance for any help you can give.
|
|
|
|
|
According to MSDN[^]'s description of the lpProcName parameter "If this parameter is an ordinal value, it must be in the low-order word; the high-order word must be zero". The MAKEINTRESOURCE[^] macro will convert the ordinal number you supply into the proper format.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
Are you sure you want to use MAKEINTRESOURCE , since it's intended for resource ID's and not DLL ordinals? Given the description of GetProcAddress , you can just pass the ordinal value in the lpProcName parameter, suitably cast to LPCSTR . I've never used ordinals with GetProcAddress , since they're so sensitive to changes.
Software Zen: delete this;
|
|
|
|
|
I never use ordinals either. I just read the description from MSDN on how to use ordinals, and it is identical to how to use numbers to load resources. So I realized the MAKEINTRESOURCE would do the trick.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
Hi all,
I've tried to find out the size of the client area of a MDI application. To me, the client area means the (application window size) - (tool bar size) - (status bar size) - (menu bar size). Usually, the size of this area can be retrieved by calling the function GetClientRect() of the ParentFrame of a View. However, I want to know the size of the area prior to the creation of a Document/View instance. I cannot call the GetClientRect() function because the ParentFrame object doesn't exist yet.
Does somebody know how to solve this?
Regards,
Willem
|
|
|
|
|
Any one know how to detect if a fullscreen application is running (for example: game, video, pp presentation, etc...)
thanks in advance...
|
|
|
|
|
You can get the active window handle (see GetActiveWindow function) and check the size (GetWindowRect function)
good luck!
Regards from Romania,
Razvan Serban
|
|
|
|
|
thx
|
|
|
|
|
hello
How to use round funcion in vc++.net ...??
I need to round off a float value, say 103.94568 to 103.95
Please help....
Salai
|
|
|
|
|
this is only a display issue...
printf("%.2f", 103.94568);
> 103.95
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
salaikumar wrote: I need to round off a float value, say 103.94568 to 103.95
What is wrong with the old-fashioned way: adding .5 and casting to int (that is throwing the decimals away)?
In your case you would additionally need to multiply by 100 before and divide by 100 afterwards to get the 2 decimal places.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
Hello
i am working on VC++.Net
Could any one please tell me how to change the back color of a particular column(not all columns) in Datagrid control.
Thanks in advance
Salai
|
|
|
|
|
Hi All,
Is there anyway to make the "Send" call of CSocket in sycrhronous way?
-Sarath
Currently I am working as software engineer at Network System Technologies Pvt. Ltd (NeST). Most of my project are in C++. Most interesting are is GUI programming.
|
|
|
|
|
need a expert to help,how to set images onto outlookbar's folder?
how to use setfolderimagelist(...)?
|
|
|
|
|
Hallo
Assume I have some classes...
One class for communication and their derived for the exteranl machine that is used. There for class DEVICE provides some virtual functions and some normal member function...
Now i want to write some libraries ( *.dll ) and they should also use the class DEVICE... but only the nonchangeable methods write and read. So i'd like to pass two function pointers the dll -- no problems so far...
But how about creating the function pointer...
I retrieve: cannot convert from 'void (__cdecl CDEVICE::*)(int,char *)' to 'void (__thiscall CDEVICE::*)(int,char *)' or other proplems i cant fix ...
this is what i have:
<br />
class CDEVICE<br />
{<br />
public:<br />
typedef void (CDEVICE::*sendfunc)(int,char*);<br />
sendfunc sendout;<br />
<br />
void _cdecl dev_out (int p_adr,char* devcmd);<br />
};<br />
...
<br />
CDEVICE::CDEVICE()<br />
{<br />
sendfunc = dev_out;<br />
}<br />
Please Help
THX T
|
|
|
|
|
short answer: you can't use pointers to non-static member functions without an instance of the object.
long answer: search CP for "member function pointer". there are a lot of articles with tricks to make doing that easier.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
Is there any way to define a shortcut to a class memeber?
For instance, a reference to System::Windows::Forms named WinForms or something.
I tried #define but I get a compiler crash in VC2005 Express Edition.
|
|
|
|
|
did you tried with typedef keyword ?
typedef System::Windows::Forms WinForms;
otherwise, you could use the using directive, but it's not recommended to.
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Hi to all. My name is Zoli and i'm in trouble in reading from a file at a given offset.
More exactly what can i do if - let's say - i calculate from the RVA of an exe's section
the fileoffset and i want to read the entire (or some bytes)
section to display in text format.
Or how can i read some bytes from an exe at given fileoffset
(fileoffset that was calculated from an RVA).
I hope i made my problem to be clear for you!
Any suggestion is apreciated! (Sorry for my horrible english). Thanx!
|
|
|
|