|
Hey~
How do you add a control to the main menu in an MFC app?
Example:
______________________________________________________
|[] My App _ [] X |
______________________________________________________
| |
| File Edit Help [control here] |
| |
|_____________________________________________________|
| |
| Toolbar here |
|_____________________________________________________|
I have no problem adding a control to the end of the toolbar... I just locate the proper coordinates and MoveWindow(). I tried that approach to display it over the menu at the right hand side (see above), but it won't display correctly... it's as if the menu is repainting itself over the control. The toolbar doesn't repaint itself over the control, though.
Thanks in advance!
thundercatzlair
|
|
|
|
|
There is an article here on CP in how to do that... sorry to give you the big job to find it!
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
I am very puzzled by this one. Previously, when one wanted to have a custom enum in the typelib, he simply put it in the library section of the idl file:
library SomeLib
{
typedef enum { someval } MyEnum;
}
and voila.
But with VC.NET, and attributed C++, how do you do that??? I tried the following:
[module .....];
[export, public]
typedef enum { someval } MyEnum;
but the declaration is not part of the typelib, since it is before the library statement in the generated idl file.
Anyone have tried this before? Is it still possible to do it? Do I have to switch back to non-attributed C++???
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
I wrote some nice code listening to him. You can't write code to the new crap that comes out these days.
|
|
|
|
|
|
Mike Nordell wrote:
42
43
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
Mazdak wrote:
43
No, 42! It could also be three, seven or 4711, but never 43.
Btw, who was "Stale Laney"? The answer to OP's post would probably be "we all die, that's the only thing that's absolute", possibly with the addition "that's the only thing we humans have to look forward to".
|
|
|
|
|
The singer from Alice in Chains. As a person from a generation earlier, I'm of the opinion he's one of the people who *destroyed* rock music. It's still a shame he died so young though.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
The singer from Alice in Chains. As a person from a generation earlier, I'm of the opinion he's one of the people who *destroyed* rock music.
OK, then he's probably a generation or two after me (and you'd be, like, 10 years now Christian? ).
If he destroyed rock music, I'd love to know why e.g AC/DC, Sabbath, Manowar ... are still on my playlists when I go into "serious hacker" mode. That's not destroyed and never will be!
|
|
|
|
|
Mike Nordell wrote:
If he destroyed rock music, I'd love to know why e.g AC/DC, Sabbath, Manowar ... are still on my playlists when I go into "serious hacker" mode. That's not destroyed and never will be!
You and I may be waving the flag, but while ACDC & Sabbath can still fill stadiums, the same is not true of most bands from those eras.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
He didn't 'have' to die. He died because he was an idiot. I like to think of it as natural selection.
|
|
|
|
|
LOL
Michael
|
|
|
|
|
friends
i created a Member object of Dialog class and
use the memberobject.Create(resourceID,parentWindow);
to create that ..
It work as fine in the DEBUG
but not in release ..Any idea????
Hai Friends me from Pandalam..and i think there is a sofware behind everything...
so enjoy with the codes...
|
|
|
|
|
Check the optimizations in the project options .
|
|
|
|
|
everything is ok on that part...
i think there is some memory issues...
Hai Friends me from Pandalam..and i think there is a sofware behind everything...
so enjoy with the codes...
|
|
|
|
|
What about creating a new Forum for Managed C++?
Al
|
|
|
|
|
Albert Pascual wrote:
What about creating a new Forum for Managed C++?
I'm still using VC++ 6 and haven't gotten a chance to check out the new .NET development environment. What're the differences between VC++ 6 and Managed C++? Is it a new derivative of the language, or just a new IDE?
-Mike Zinni
Software Engineer
email: mzinni@rimail.com
AIM: zin9999
|
|
|
|
|
This question best answered by somebody at Microsoft like Nick Hodapp.
But in my modest opinion MC++ is like C# but better as you can add managed and unmanaged code (without P/Invoke)
It's more than C++ with a gargabe collection, has the same classes than C# and as flexible as C++
Cheers
Al;P
|
|
|
|
|
Why not just post your questions here for now? There haven't been too many MC++ questions in the past. If enough people do so, it might make sense for Chris to create a new forum.
--------
And we die young.
Faster we run. Alice in Chains, We Die Young
|
|
|
|
|
I thought that if we had a C# forum we should also have one for MC++.
Al
|
|
|
|
|
Albert Pascual wrote:
I thought that if we had a C# forum we should also have one for MC++.
There is no VB.NET forum though.
[dodges flaming arrows]
--------
And we die young.
Faster we run. Alice in Chains, We Die Young
|
|
|
|
|
I agree. MC++ and C-hash has nothing to do with C++ (even that this forum is really Visual C++ which isn't C++ by a longshot).
|
|
|
|
|
Hi,
I'm trying to create dsn's programatically for an installation I'm doing. When I create them either by setting the registry setting (ID: Q184608) or calling the following:
<br />
#include "stdafx.h"<br />
<br />
#include "stdio.h"<br />
#include "windows.h"<br />
#include "sql.h"<br />
#include "odbcinst.h"<br />
<br />
<br />
int main(int argc, char* argv[])<br />
{<br />
RETCODE retcode;<br />
<br />
retcode = SQLConfigDataSource(NULL,<br />
ODBC_ADD_DSN,<br />
"SQL Server",<br />
"DSN=MY_TEST\0"<br />
"LastUser=test_user\0"<br />
"Database=test_database\0"<br />
"Driver=C:\\WINNT\\System32\\sqlsrv32.dll\0"<br />
"Server=test_server\0\0");<br />
<br />
return 0;<br />
}<br />
The DSN doesn't show up in the ODBC Data Source Administrator. I even exported the settings from the registry to make sure everything was being set correctly.
Can anyone point me in the right direction as to why they don't show up?
Thanks in advance,
Craig
|
|
|
|
|
Hi Guys I an trying to read in a binary file to a variable called buffer.
See code below
buffer is defined as char *
but when I debug code, buffer only seems to hold the first character from the file.
What I am trying to achieve is to read in the file search it for a particular string and when I find
this string, read in the entry in the file which is x characters after the first found string
I know 'seekg' can read in characters from a given position.... but firstly I have to find the position
of a particular string in the file.
The file is an SQL Server Profiler trace file.
Is there some other way I can do this - Is there any way I can serach the file without reading it in...
or do I need to declare buffer in a different way.
Any ideas would be appreciated
Cheers
=====================================================
// readbinaryfile.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream.h>
#include <fstream.h>
#include <string.h>
const char * filename = "C:\TenforeFeed.trc";
char * buffer;
long size;
char * pch;
int main(int argc, char* argv[])
{
ifstream file (filename, ios::in|ios::binary|ios::ate);
if(file.is_open())
{
size = file.tellg();
file.seekg (0, ios::beg);
buffer = new char [size];
file.read (buffer, size);
cout << buffer[3];
//delete[] buffer;
}
return 0;
}
========================================================
|
|
|
|
|
I'm assuming, the value returned by tellg is the correct value. If so, try it with a file you construct using Notepad. If the file contains UNICODE data, typically, every other byte is 0. This causes the string to look like it is only one character long.
Hope this helps,
Bill
|
|
|
|