|
how can i disable a an active x's right click event..?????
[.1]
|
|
|
|
|
Hi All!..
I'm trying to create dll which include dialog in it.
here what I did
1) create new MFC AppWizard dll project with regular dll share MFC dll, named testingDlg
2) insert new dialog IDD_DIALOG1 with ok and cancel buttons
3) right click, choose classwizard. that's make me create of dlg1 class for the dialog1
4) I add function ONOK,
void dlg1::OnOK() <br />
{<br />
AfxMessageBox("hello ");<br />
CDialog::OnOK();<br />
}
5) insert new class, dlgA, to testingDlg
6) add new function call showDlg(bool true) and insert the following code
<br />
void dlgA::showDlg(bool show)<br />
{<br />
if (show)<br />
{<br />
if(d1.DoModal()==IDOK)<br />
{<br />
AfxMessageBox("you did it");<br />
}<br />
}<br />
}<br />
7) i compile testingDlg and without any error, testingDlg.dll and testingDlg.lib get created
but when I called showDlg(true); from another application, I got the following error
<br />
testingDlg\dlg1.h(23) : error C2065: 'IDD_DIALOG1' : undeclared identifier<br />
testingDlg\dlg1.h(23) : error C2057: expected constant expression<br />
Generating Code...<br />
<br />
Error executing cl.exe.<br />
<br />
TestingDll.exe - 2 error(s), 0 warning(s)<br />
can anybody tell me why I got errors??
Thank you
|
|
|
|
|
Here is one good reference on MFC DLL.
http://www.mindcracker.com/mindcracker/c_cafe/dll.asp
Kuphryn
|
|
|
|
|
I was just going over all my old disks and found snip9707.zip. This is a collection of over 700 files and I am glad I found it. I did a quick search via google and found that it is still available for download. Be carefull though, the copy that I have is not infected but apparently there were some infected copies out there. So be sure to scan it. Now go search for snip9707 and enjoy.
If any one knows I can find other archive like this please let me know.
If you don't use it you lose it. Fight senility use you brain.
|
|
|
|
|
Hi, I have a flicker in my program when it calls onPaint(), so I was wondering how to double buffer my graphics. All I'm calling are some simple FillRect functions. Thanks.
Robert
|
|
|
|
|
Flicker Free Drawing In MFC[^]
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Check out
http://www.codeproject.com/bitmap/bitmapdc.asp?target=cbitmapdc&df=100&forumid=160&select=49439#xx49439xx
It works great for a the applications I've been working on.
|
|
|
|
|
Is there any function which returns number of decimals in the integer,
or can sombody help me with fast algorithm to do this. thanks
|
|
|
|
|
int digits = log10(integer) + 1; Only works with positive numbers.
HTH
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
pepevejlupek wrote:
Is there any function which returns number of decimals in the integer
Trick questions should probably be directed to the lounge.
The number of decimals in an integer is always zero.
|
|
|
|
|
Subtle, dude .
Software Zen: delete this;
|
|
|
|
|
int CountDigits(int value)
{
int digit_count = 0;
do {
digit_count++;
value /= 10;
} while (value != 0) {
return digit_count;
}
or, even faster:
int CountDigitsFaster(int value)
{
int digit_count = 1;
if (value < 0) value = -value;
if (value > 9) digit_count++;
if (value > 99) digit_count++;
if (value > 999) digit_count++;
if (value > 9999) digit_count++;
if (value > 99999) digit_count++;
if (value > 999999) digit_count++;
if (value > 9999999) digit_count++;
if (value > 99999999) digit_count++;
if (value > 999999999) digit_count++;
return digit_count;
}
Note that CountDigitsFaster assumes that int 's are 32-bit signed values. Both functions assume that the minus sign in negative values is not considered a 'digit'. If you're actually trying to compute the number of characters required to display the value, then you would have to take that into account as well. CountDigitsFaster looks like dumb code, but is significantly faster than any alternative I can think of. It requires 10 compares, 10 jumps, possibly a negation, and up to 9 increments. My original CountDigits , while it may exit with an early out for small values, requires an increment and a division per iteration, for up to 9 iterations.
Software Zen: delete this;
|
|
|
|
|
I would like to see examples in VC6 about performance counter ( creating new performance counter)
Thanks
Luis Ricardo
|
|
|
|
|
|
|
The link u hv provided is not working. Do u know any other links?
|
|
|
|
|
MFC Print Preview - help urgently
Helpp!!! I printed a few pages using CView::OnDraw override, hence, did not take into consideration the current page being printed. So the problem is that I do not print taking into consideration the current page being printed. As a result, the output gets slower when the data to be printed increases and even overlapped. Please Help!!!!
|
|
|
|
|
Hello,
how can I open another FormView in a MDI-Appl. from a FormView ? Not from the Main-Menu !
Example:
There is a Button in CFormView1. With this Button, I
want to open/create the CFormView2. How can I do that ?
Is there a axample application/source?
Thanks, jr
|
|
|
|
|
// Get the correct document template
CDocTemplate* pDocTemplate;
POSITION pos = pApp->GetFirstDocTemplatePosition();
pDocTemplate = pApp->GetNextDocTemplate(pos);
ASSERT(pDocTemplate);
// Create the new frame
CFrameWnd* pNewFrame = pDocTemplate->CreateNewFrame(GetDocument(),
(CFrameWnd*)AfxGetMainWnd());
ASSERT(pNewFrame);
// Activate the frame and set its active view
pDocTemplate->InitialUpdateFrame(pNewFrame, NULL);
|
|
|
|
|
How can I open the CFormView2 , which have no Doc-Class ?
Thanks, jr
|
|
|
|
|
I'm making a program where i need the hWnd of the control that is currently under the cursor, but i'm in doubt of which API's i should use. I've tried checking around but i can't seem to find the answer.
Thanks in advance
|
|
|
|
|
WindowFromPoint() or possibly ChildWindowFromPoint()
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
You might want search MSDN there is an old sample program on using DIBs. What the program does is allow you to move the cursor over a window a capture it to a DIB. If you search for a screen/windows capture program here or on the web you should be able to find additional examples.
Trust in the code Luke. Yea right!
|
|
|
|
|
Why does the colour black get displayed transparently in a CListCtrl given an associated imagelist.
How do I preserve the black colour .. ?
Thanks in advance.
|
|
|
|
|
Depending upon how you create the image list, the color black can be used as a mask value. Pixels in the bitmaps that are the mask color are displayed as transparent.
The easiest way to handle transparency with an image list is to use icons, rather than ordinary bitmaps.
Software Zen: delete this;
|
|
|
|