|
the problem is that (i think) i have some code which should work (i already posted here!)
so i have something which i don't know why it doesn't work
what i want? i have explained
what i do? i posted the code
why it doesn't work? who knows
the problem why i give little information is that i don't have much information
i don't really know what to post more?
but i will do a new thread
thx
|
|
|
|
|
Hello,
This[^] class / lib has some handy functions to work with images. I saw some functions that you can use to get your pixel. If you only want to get that pixel, the class is somewhat excessive.
You can also use the GDI do work with the bitmaps. Start some reading here[^] to get aquainted with it..
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
I want to Refresh or erase the content of my CRichEditCtrl
Please tell me the Class Member function i want to choose
|
|
|
|
|
dittygrail wrote:
I want to Refresh or erase the content of my CRichEditCtrl
Hows this?
// Delete all of the text.
pmyRichEditCtrl->SetSel(0, -1);
pmyRichEditCtrl->Clear();
CRichEditCtrl Class Members[^]
-------------------------------
|
|
|
|
|
dittygrail wrote:
I want to...erase the content of my CRichEditCtrl
Please tell me the Class Member function i want to choose
What's wrong with SetWindowText("") ?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
hi all,
I have a CHtmlView, when I right click the view, a default menu pops up, which contains a set of menu items (such as Refresh, Back, Fonts).
Now I want to remove the popup menu.
I have tried all but the menu is still there and can not be removed.
by the way, disable messages on PreTranslateMessage() function does not work as I tested.
could u halp me?
thx
includeh10
|
|
|
|
|
Did you try:
CHtmlView::OnShowContextMenu
And this will do the job anyway:
By implementing IDocHostUIHandler interface.
this is this.
|
|
|
|
|
Friends,
In my MFC based application, the main application window is somethime visible and sometimes not. Whn i made my window invisible using ShowWindow(0) , its taskbar button also becomes invisible. What i want is that task bar button should remain visible whether application windows is visible or not.
How can i do so?
Imtiaz
|
|
|
|
|
Imtiaz Murtaza wrote:
Whn i made my window invisible using ShowWindow(0)
Instead of making it Invisible by calling ShowWindow(SW_HIDE), resize it to 0,0 so that window become invisible from desktop but taskbar button remain visible
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
|
Hi,
While working with CAsyncSocket we discovered that our application has a memory leak. Tracing it we finally found that inside CAsyncSocket class a new window is created for every socket object. Trying the following code:
for (int i=0; i<6000; i++)
{
CWnd* pWnd = new CWnd;
pWnd->CreateEx(0, AfxRegisterWndClass(0),_T("Socket Notification Sink"),
WS_OVERLAPPED, 0, 0, 0, 0, NULL, NULL);
pWnd->DestroyWindow();
delete pWnd;
::Sleep(10);
}
we tested it to realize that it causes a memory leak in our app.
Is there some problem with CreateEx?
|
|
|
|
|
Are you sure that the memory leak is a CWnd object?
Don't try it, just do it!
|
|
|
|
|
I'm not sure where the leak is, but if I change the call to CreateEx (for example different styles for the window) I can't see it anymore.
|
|
|
|
|
There is an easy way to trace memory leaks.
When your application closes, then you remember the byte count of the leaks the debugger is displaying.
Now set a checkpoint at the new operator routine (breakpoint at a new call, and then step into) with a condition of n = byte count.
Now the debugger will break every time an object with size n is allocated... just step out of the new operator and you will see what object it is.
Don't try it, just do it!
|
|
|
|
|
The debugger doesn't report a memory leak, that's why it's so confusing. But looking at the amount of memory the application consumes it constantly goes up and only goes down when I close the app.
If you can try those few lines of code I posted above you will see it happening.
|
|
|
|
|
Hi,
im trying to use the specific value of an array in a computation in another function; but don't know how to set it up. In test(), i want to use the 6th value of C[] in the computation. How do i set this up please?
<br />
#include "stdafx.h"<br />
#include <cmath><br />
<br />
const int size = 10;<br />
double A[size] = {0},B[size] = {0}, C[size],c,d;<br />
<br />
double PI = 3.141592653589793238462643383279502884197;<br />
<br />
void rah(double C[])<br />
{<br />
<br />
for (int i=0;i<size;i++)<br />
{<br />
A[i] = sqrt(10*i);<br />
B[i] = 2*PI*i;<br />
C[i] = A[i]*B[i];<br />
}<br />
}<br />
<br />
double test()
{<br />
rah(C);<br />
d = PI * rah(C[5]);<br />
<br />
}<br />
<br />
<br />
int main(int argc, char* argv[])<br />
{<br />
test();<br />
return 0;<br />
}<br />
<br />
|
|
|
|
|
i am not clear abt ur requirement. try this
#include <stdio.h>
#include <math.h>
const int size = 10;
double A[size] = {0},B[size] = {0}, C[size],c,d;
double PI = 3.141592653589793238462643383279502884197;
double rah(double *C)
{
int i = C-::C ;
A[i] = sqrt(10*i);
B[i] = 2*PI*i;
::C[i] = A[i]*B[i];
return ::C[i] ;
}
double test()//how do i write this correctly?
{
d = PI * rah(&C[5]);
return d ;
}
int main(int argc, char* argv[])
{
printf("Hello World!\n %f", test());
return 0;
}
naren
VC++ programmer
|
|
|
|
|
aaadetos wrote:
In test(), i want to use the 6th value of C[] in the computation. How do i set this up please?
double test()//how do i write this correctly?
{
rah(C);
d = PI * rah(C[5]);
}
It appears that you are already using "the 6th value of C[] in the computation." What is it that you think is wrong?
The code that I do see as wrong is when you are calling the rah() function. rah() is expecting a double array (i.e., C[] ), yet you are calling it with a single double value (i.e., C[5] ).
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Thanks a lot guys. The dilemma was to use one of the elements (the 6th) in the computation. I implemented test() in the following way:
<br />
double test()<br />
{<br />
rah(C);<br />
d = PI * C[5];<br />
return d;<br />
}
|
|
|
|
|
Why is d a global variable? Unless absolutely necesssary, that is very poor practice. In this instance, it makes no sense for test() to return d since it is already global. Either make d local to the test() function, or change test() to return nothing.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hi!
I have a begginers question. How do I provide many options in one function argument like Win32 API does for example (not real function):
a.) DrawDialog(FRAMED | GREY | BOLD);
Here dialog window will have all requested behaviour.
b.) DrawDialog(FRAMED);
Here dialog window will be just framed, other options will be something by default.
I'd like to do something like that in my program. I have many LED's with colours green, red, orange. Example:
a.) SetLED(green, red, orange);
In this case all LED's with this colour would be led up.
b.) SetLED(green, orange);
In this case all LED's with this colour green and orange would be led up, green would be left alone.
Can anyone please help me and sugest how do I do that?
Best regards,
Rostfrei
|
|
|
|
|
It is not using multiple arguments but using one single argument that is used as a flag:
<br />
#define LED_GREEN 0x001<br />
#define LED_BLUE 0x002<br />
#define LED_RED 0x004<br />
The define are just to set one bit to 1
And so, inside your function, you check if the specified bit is set:
void SetLed(int LedMask)<br />
{<br />
if (LedMask & LED_GREEN)<br />
<br />
...<br />
...<br />
}<br />
[EDIT] I forgot to say that:
You can then call your function like that:
SetLed(GREEN_LED | RED_LED);
That will activate the green and red leds
Hope this helps
|
|
|
|
|
That is exactly what I needed. Thank you!
Rostfrei
|
|
|
|
|
hiho@ll
i'm working on a browser helper object, which should have a "Boss coming" feature
the problem is how can i change the Location URL of IE?
what i do:
to load the url fast i have a local copy of google index.htm site with the google logo
i'm loading the file using navigate function, but the Location points to a local file!
using the IWebBrowser interface i only found a get_LocationURL function, but i need a set_LocationURL!!
anybody knows such a function
thx@ll
|
|
|
|
|
I have an activeX control and need to make a setup program and force setup to call DllRegisterServer , how can I achieve this?
|
|
|
|