|
Do not use OpenGL - that is a graphics library, and has very limited event (read mouse click) support. Are you being asked to write your own custom menuing system for a console application? If so - it simply a matter of doing some hard work over the next few days.
My neighbours think I am crazy - but they don't know that I have a trampoline. All they see my head bobbing up and down over the fence every five seconds
|
|
|
|
|
yes... i need to write own custom menuing system for a application....
|
|
|
|
|
The data structure would something like
vector < map < string, void* > >
where the void* points to each of your functions, and the string is what is displayed in the menu.
My neighbours think I am crazy - but they don't know that I have a trampoline. All they see my head bobbing up and down over the fence every five seconds
|
|
|
|
|
silvergoat wrote:
any idea in making a menu bar in win32 console application?
console ? like text only application ?
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
if u dunno how useful opengl in vc ++ pls... keep quiet.. thanks
|
|
|
|
|
Are you saying that asking questions to get a better understanding of the problem is prohibited?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
well, if it's for an openGL application ( not the same thing as a console application ) , have a look at GLUT, the OpenGL Utilities Toolkit (http://www.opengl.org/documentation/spec.html[^] )
If you want to do everything manually, it's a lot of work, you need to draw everything, handle the different messages ( mouse movements, callbacks, ... ).
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
I'm trying to use the Boost Regex[^] library in my MFC SDI app but am having some problems including the files as they instruct.
I've built the library per their instructions[^]
I added the C:\boost path to my include directories for my project
I added #include <boost/regex.hpp> to the top of the file I intend to use it in ... yet I still get a compile-time error saying the following:
MyAppName fatal error LNK1104: cannot open file 'boost_regex_vc7_mdid.lib'
Any ideas what I'm doing wrong, or how to fix it?
Thanks very much,
Dave
|
|
|
|
|
You also need to add the boost library path in the options of your vc++ installation
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I tried adding the C:\boost path to the VS.NET library includes path, and it diesn't work.
I also tried adding C:\Visual Studio .NET\Vc7\lib (where that library file actually resides) to both the VS.NET library path definition, and the project library definitions path and no luck.
One more thing ... I'm not using pre-compiled headers ... if that would make any difference.
Thanks for the suggestion. Any others?
|
|
|
|
|
I ended up including the path to the .lib files in the linker section of the properties.
I'd forgotten to do that, and the setup instructions were somewhat vague.
|
|
|
|
|
Hi all,
I'm using a list"double" variable in my code. Even though I added the #include "list" to the beginning of the file, I keep getting a 'undeclared identifier' message. What's missing? Best,
Ralf.
ps " = angled brackets. Can't display those.
ralf.riedel@usm.edu
|
|
|
|
|
RalfPeter wrote:
ps " = angled brackets. Can't display those.
Sure you can. Just click on the < and > in the Formatting bar above the smileys.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Be sure to use:
using namespace std;
or use:
std::list<double>
Perl combines all the worst aspects of C and Lisp: a billion different sublanguages in one monolithic executable. It combines the power of C with the readability of PostScript. -- Jamie Zawinski
|
|
|
|
|
Good deal, it worked. Thx.
|
|
|
|
|
In order to type angle brackets in a message, use < for < and > for >. These are the 'character entities' in HTML for those respective characters.
Software Zen: delete this;
|
|
|
|
|
Hi all,
I'm using a list<double> variable in my code. Even though I added the #include <list> to the beginning of the file, I keep getting a 'undeclared identifier' message. What's missing? Best,
Ralf.
ralf.riedel@usm.edu
|
|
|
|
|
after the include put this line.
using namespace std;
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
I use an owner draw combobox to show a bitmap in front of each item in the listbox.
This works as long as the combobox is a list box. (the drawitem() func is called for each item in the list)
But I want to use a drop down combo (with an edit box)
So I also want to draw a bitmap in front of the value typed in the edit box.
Just like internet explorer does.
How should I do this? Any ideas / code samples?
|
|
|
|
|
I'd be surprised if you don't find an article on this here at CP. Have you searched the site? The edit control would be the only real difference to what you already have and would need specific code.
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
Hello,
I'm coding two apps that swap data (client / server) over TCP/IP, SOCK_STREAM, using my derived classes from CSocket and CAsyncSocket. Data is stored in a custom struct (size 3k) known to both apps.
Code snippet:
---- sending data using CSocket
tagDATA data; // data to send, its a struct
// use my derived CSocket to send:
m_Socket.Send (&data, sizeof (tagDATA));
----- receiving data using CAsyncSocket
void CMyAsyncSocket::OnReceive(int nErrorCode)
{
tagDATA data;
CAsyncSocket::OnReceive(nErrorCode);
int iRcvd = Receive (&data, sizeof(tagDATA));
// process data here...
}
It all works fine when both programs are running on the same machine, however when transmitting data over the network each 3k data block is chopped into chunks of size (1460 * i) bytes. 1460 seems to be the ethernet frame size.
The problem is of course that I wont receive correct tagDATA objects (I dont get all data with the first call to Receive() ), but instead several chunks for each one send. Is this normal socket behaviour? Will I have to reassemble the received chunks "by hand"? SO_RCVBUF is set to 8k by default. I cannot find any hint about max buffer size in MFC's CAsyncSocket::Receive documentation.
I tested this behaviour with MS MFCSocs example - it seems to behave similar: When sending approx 8k the data gets chopped into two bits (3k and 5k).
Any help is greatly appreciated,
Steve
|
|
|
|
|
Welcome to the wild world of socket programming! This is the normal behaviour. What you need to do is copy the data in chunks to your buffer, keeping a running offset.
onwards and upwards...
|
|
|
|
|
Yes, thanks for your reply. I just completed coding this and it seems to work.
However I'm afraid this will mess up my communication sooner or later: For instance isnt't it possible that one chunk of data might get lost? Afterwards my offset will be invalid and I will interpret all following chunks incorrectly (putting them into the wrong offset into the buffer).
Of course I can reset the offset after a certain time (for instance I notice I only receive "crap") however I think this is more of a workaround than a solution, and all the data chunks from inbetween will be lost too.
Regards,
Steve
|
|
|
|
|
The job of the TCP part of the TCP/IP stack is to resequence the packets in the correct order for you. So, unless you are using very low level socket calls (which I would doubt), you don't have to worry about that.
onwards and upwards...
|
|
|
|
|