|
You probably have a module-definition (.def) file which has a LIBRARY statement in it.
The LIBRARY statement is actually unnecessary, you can simply remove it.
--
Mike Dimmick
|
|
|
|
|
Does this means that my dll do not have any problems?
How about the second question? my Exe (in debug mode) still looking for MyDll.dll (release version) and not the debug version.. aaahhhh,...
|
|
|
|
|
I m developing a whiteboard program.
I need to implement text drawing on a view as in Win Paintbrush.
Could anyone give me some suggestion?Some sample code is better.
Thanks
|
|
|
|
|
A good basis for something like this would be the SCRIBBLE sample program that comes with MSDN.
You could have a toolbar which switches between graphic modes. In Text mode, you can detect a
OnLButtonUp event in your view and pop a box asking for text.
There are plenty of text input dialog boxes here on CodeProject you could use. And its not hard
to get ClassWizard to make a dialog box with an edit box in it for you. If you are clever, you
could handle EN_CHANGE notifications from the edit box and live-update the view with the text
you are typing in.
For drawing the resultant text, just use
pDC->DrawText (...) function.
I hope that helped,
Iain.
|
|
|
|
|
Thanks!!
With your reply ,I get the way to solve my question!
Just 3 type as you said, right?
1. make a resource to tell my view that i will draw text on it
2. catch LBUTTONUP message and pop a edit box
3. Notify the view and DrawText
baybe it ll take me sometime to solve it.Anyway, thanks for your advise!
|
|
|
|
|
I would do this in the following order:
Forget about the UI to start with, amd simply practice drawing text into the View at a hard
coded place. This will let you learn about CFont, pDC->SelectObject, pDC->SetTextBkMode,
pDC->TextOut / pDC->DrawText.
Then make a toolbar so you can switch between graphic modes (pen, line, text, etc).
Create Command Handlers for them, so the button / menu for the current tool is inset / ticked.
Then in your mouse button handler, pop up a box to input some text. Add the text and its
coordinates (from the mouse position) to a list of some kind in your CMyDocument. Redraw
the screen with the new text.
Relax in a warm glow of achievement. Have a or to taste.
Iain.
|
|
|
|
|
Class CA
{
protected:
CA();
private:
int a;
int b;
CRect c;
}
CA::CA():c(0,0,100,100){
a=0;
b=0;
}
What's the difference between both of the initialization ways in function "CA()"?
Thank you in advance!
|
|
|
|
|
The initialisation list you used with you variable c is executed before the constructor is even called - it is part of the allocation of the instance.
But on the other hand, you have to be careful: The initialisation list does not care about the order in which you placed them - the are executed in the order the variables are allocated (declared). After all, initialisation lists are part of the allocation.
OTOH, a and b are of undefined value before they get assigned a value. (and they need an assignment operator able to cope whith the values they got assigned - initialisation lists do not.
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
Thank you!
|
|
|
|
|
Is there a way to increase the font size in a console application? A larger text would be nicer to read.
Thanks, Dave
VC++ 6.0
|
|
|
|
|
Simple answer, no.
The user can change the console settings themselves, (font, number of columns, rows etc), but the
console takes what is given. If a spiffy UI is what you want, console is not the way to go...
I *believe* you can stream out escape characters to make parts of your text bold, but I'm not too
sure.
Iain.
|
|
|
|
|
I guess that you could configure your console font size in windows if i am not mistaken.
|
|
|
|
|
Thanks
"The man who reads nothing is better educated than the man who reads nothing but newspapers."- Thomas Jefferson
|
|
|
|
|
Is there a way to set a console application to open "full screen" when it is built as a final release? I know you can right click and go to "properties" to set the window to full screen, but can I enter some code to permanently do the same thing? Thanks.
VC++ 6.0
|
|
|
|
|
Use GetConsoleDisplayMode to see if the window needs to change and if it does send Alt-Enter to the consol window. Thats the only way I know. I havent seen any API that changes the fullscreen mode of a consol window.
Magnus
|
|
|
|
|
I'm working on the program below. It sorts numbers fine, but it only lets me sort ONE number. I want to have the option to either choose to enter another search or quit. I'm not sure how to setup the program to repeat the search. How can I accomplish this. Thanks, Dave.
<br />
<br />
#include <iostream><br />
#include <cstdio><br />
using namespace std;<br />
<br />
int main()<br />
<br />
{<br />
int x;<br />
int i;<br />
char str[80];<br />
char Info [] [300] = <br />
{<br />
"3030-02-000-5287" , "Here is the information for this number."<br />
"3030-03-000-0029" , "Here is the information for this number."<br />
};<br />
<br />
cout<<"Please enter a number:\n";<br />
cin>>str;<br />
<br />
for(i=0; i < 4; i += 2)<br />
if(!strcmp(str, Info[i]))<br />
{<br />
cout<<"Information:"<<Info[i+1]<<"\n";<br />
break;<br />
}<br />
<br />
{if(i == 4)<br />
cout<<"Number not found.\n";<br />
}<br />
<br />
{cout<<"\nWould you like to check another?\n";<br />
cout<<"Enter 1 for yes, 0 for no.\n";<br />
cin>>x>>"\n";}<br />
<br />
<br />
return 0;<br />
}<br />
<br />
-----------------------------------------------------
VC++ 6.0
|
|
|
|
|
int main()
{
int x;
int i;
char str[80];
bool isfinished=false;
char Info [] [300] =
{
"3030-02-000-5287" , "Here is the information for this number."
"3030-03-000-0029" , "Here is the information for this number."
};
while(isfinished==false)
{
cout<<"Please enter a number:\n";
cin>>str;
for(i=0; i < 4; i += 2)
if(!strcmp(str, Info[i]))
{
cout<<"Information:"<<Info[i+1]<<"\n";
break;
}
if(i == 4)
{
cout<<"Number not found.\n";
}
x=-1;
cout<<"\nWould you like to check another?\n";
while(x!=0 && x!=1)
{
cout<<"Enter 1 for yes, 0 for no.\n";
cin>>x>>"\n";
}
if (x==0)
isfinished=true;
}
return 0;
}
~RaGE();
|
|
|
|
|
I get the following message Rage when I run the code:
Compiling...
rage.cpp
C:\Program Files\Microsoft Visual Studio\MyProjects\Rage NSN Lookup\rage.cpp(22) : error C2065: 'strcmp' : undeclared identifier
Error executing cl.exe.
-----------------------------------------------------
it's this line below:
if(!strcmp(str, Info[i]))
-----------------------------------------------------
Rage NSN Lookup.exe - 1 error(s), 0 warning(s)
VC++ 6.0
|
|
|
|
|
Look in the MSDN for strcmp you will see that it says it requires a header file, from memory string.h . Also you will see what, if any, extra libraries it requires.
Simply press F1 when you cursor is over the strcmp text in your file.
If I have seen further it is by standing on the shoulders of Giants. - Isaac Newton 1676
|
|
|
|
|
Add
#include <string.h> at the top of the file.
But this means the code you've posted did not compile, then ...
~RaGE();
|
|
|
|
|
I forgot the "string.h" header include. I got your code to compile with no errors or warnings, BUT when I run the program, it hangs up with a warning that it couldn't write to memory. This occurs when I enter a "1" to continue searching. Any ideas?
Thanks much, Dave.
VC++ 6.0
|
|
|
|
|
I would expect the way you handle the Info table to be the problem (I have actually never seen a table be initialised und used that way, but that's probably because I'm a poor programmer ). Try and debug the program to see where it asserts.
~RaGE();
|
|
|
|
|
Thanks Rage, that while statement worked great...
The problem was that I needed to remove the "\n" from at the end of the cin<
|
|
|
|
|
Hi!
I created a standard MFC form view based program. And I want to control its scroll bar in my program.
In my program, I need the scroll bar's scrolling range from 0 to 299000.
In response of the message:
OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
I find the nPos value range is 0 to 32xxx, which I belive is a 16 bit data type. (each time, when I scroll it right and it increses beyond 32xxx, it suddenly turns to 0 and starts again from 0).
Now, the problem comes: I use a int type counter to indicate where the scroll bar is and update its position (also update some other variables in my program). But since the nPos only has limited range, each time when I scroll greater than 32xxx, the OnHScroll returns me a wrong number and the scroll bar will not working properly.
Any idea of this?
Thanks.
|
|
|
|
|
To use 32bit scroll values you need to use GetScrollInfo() and SetScrollInfo().
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|