|
I am confused on the matter actually, MSDN states that LoadCursor will not load the cursor if it has already been loaded but that sounds fishy to me. I was also thinking to call DestroyCursor just before the function returns. I think that would probably take care of every LoadCursor call wouldn't it?
|
|
|
|
|
hi, my quiestion is not related to VC++ programming.so forgiveme
my problem is i download some *.ps file. how can i open this file. i searched the google and i fooundout tha ps=post script. but i didn't find any utiliti to open this file.
it seems that ps is related to Some king of Printing files, plzz help meeee
thanx
|
|
|
|
|
http://www.cs.wisc.edu/~ghost
Regards,
Martin
--------------------------------------------
C'mon we all know computers are experimental devices and should only be used for playing games.
Using them for alternative stuff like business, is clearly not using them for what they are intended.
Colin Davies
|
|
|
|
|
I have seen source code on creating region information from BMP's by making one color transparent.
Is there any code available which can create regions to be used in skins from transparent png etc files.
In my dream, I was dorwning my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
|
Hi guys,
I have a MDI App without doc/view. The App start with 4 child windows open in Cascade. I would like them to open with "Tile" Style. How can I do that?
Thanks.
|
|
|
|
|
::TileWindows
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
Thanks!! That's what I needed.
|
|
|
|
|
Hello all. I'd like to use something that approximates a Class Specific #define without using namespaces, static const's or enums. Actually enums in the class would be good except some of the defines are floating point numbers.
1 header file has #define MAX_LASER_POWER 23.3, another has #define MAX_LASER_POWER 44.0
Anybody have a clever way to elegantly encapsolate these defines?
Thanks in advance!
|
|
|
|
|
Well, you could try this:
class A
{
public:
static const double MAX_LASER_POWER;
};
[EDIT] Oops, I forgot the "const".
const double A::MAX_LASER_POWER = 23.3;
class B
{
public:
static const double MAX_LASER_POWER;
};
[EDIT] Oops, I forgot the "const".
const double B::MAX_LASER_POWER = 44.0;
You will get basically the same results as using a #define since they are const.
Chris Richardson
Programmers find all sorts of ingenious ways to screw ourselves over. - Tim Smith
|
|
|
|
|
I want to write an SNMP extension agent for one of my applications, that run on a Windows 2000 server.
How do i return an array of values in a GET or GETNEXT request?
I made an MIB that looks like this:
What does the extension agent say when it gets a request for
enterprises.radical.software.apps.radicalserver.radicalserverinstance.serverconnections
since it actually points to a list of connection objects
Also how is the members of the connections array accessed. Is it like
enterprises.radical.software.apps.radicalserver.radicalserverinstance.serverconnections.0
enterprises.radical.software.apps.radicalserver.radicalserverinstance.serverconnections.1
etc....
RADICALSERVER-MIB DEFINITIONS ::= BEGIN
IMPORTS
enterprises
FROM RFC1155-SMI
OBJECT-TYPE
FROM RFC-1212
DisplayString
FROM RFC-1213;
radical OBJECT IDENTIFIER ::= { enterprises 15812 }
software OBJECT IDENTIFIER ::= { radical 1 }
apps OBJECT IDENTIFIER ::= { software 1 }
radicalserver OBJECT IDENTIFIER ::= { apps 1 }
radicalserverinstance OBJECT_TYPE
SYNTAX RadicalServerInstance
ACCESS not-accessible
STATUS mandatory
DESCRIPTION "Radical Server Instance"
::= { radicalserver 1 }
RadicalServerInstance ::=
SEQUENCE
{
serverstatus INTEGER,
serverinstancename DisplayString,
serverinstancetype DisplayString,
serverincomingmsgs INTEGER,
serveroutgoingmsgs INTEGER,
serverconnectcount INTEGER
}
serverstatus OBJECT-TYPE
SYNTAX INTEGER
ACCESS read-only
STATUS mandatory
DESCRIPTION "The Status of the server 1 - up, 0 - down"
::= { radicalserverinstance 1 }
serverinstancename OBJECT-TYPE
SYNTAX DisplayString
ACCESS read-only
STATUS mandatory
DESCRIPTION "The name of the instance"
::= { radicalserverinstance 2 }
serverinstancetype OBJECT-TYPE
SYNTAX DisplayString
ACCESS read-only
STATUS mandatory
DESCRIPTION "The type of the instance"
::= { radicalserverinstance 3 }
serverincomingmsgs OBJECT-TYPE
SYNTAX INTEGER
ACCESS read-only
STATUS mandatory
DESCRIPTION "No. of incoming messages per second"
::= { radicalserverinstance 4 }
serveroutgoingmsgs OBJECT-TYPE
SYNTAX INTEGER
ACCESS read-only
STATUS mandatory
DESCRIPTION "No. of outgoing messages per second"
::= { radicalserverinstance 5 }
serverconnectcount OBJECT-TYPE
SYNTAX INTEGER
ACCESS read-only
STATUS mandatory
DESCRIPTION "No. of outgoing messages per second"
::= { radicalserverinstance 6 }
serverconnections OBJECT-TYPE
SYNTAX SEQUENCE OF serverconnection
ACCESS not-accessible
STATUS mandatory
DESCRIPTION "Connection list on the server instance"
::= { radicalserverinstance 7 }
serverconnection OBJECT-TYPE
SYNTAX ServerConnection
ACCESS not-accessible
STATUS mandatory
DESCRIPTION "Connection on the server instance"
::= { serverconnections 1 }
ServerConnection ::=
{
serverconnectionid DisplayString
serverconnecttype INTEGER
serverconnectstatus INTEGER
serverincomingmsgs INTEGER
sreveroutgoingmsgs INTEGER
}
serverconnectionid OBJECT-TYPE
SYNTAX DisplayString
ACCESS read-only
STATUS mandatory
DESCRIPTION "Identifier of the connection"
::= { serverconnection 1 }
serverconnecttype OBJECT-TYPE
SYNTAX INTEGER
ACCESS read-only
STATUS mandatory
DESCRIPTION "Type Incoming = 0, Outgoing = 1"
::= { serverconnection 2 }
serverconnectstatus OBJECT-TYPE
SYNTAX INTEGER
ACCESS read-only
STATUS mandatory
DESCRIPTION "disconnected = 0, connected = 1"
::= { serverconnection 3 }
serverincomingmsgs OBJECT-TYPE
SYNTAX INTEGER
ACCESS read-only
STATUS mandatory
DESCRIPTION "No of incoming messages per second"
::= { serverconnection 4 }
serveroutgoingmsgs OBJECT-TYPE
SYNTAX INTEGER
ACCESS read-only
STATUS mandatory
DESCRIPTION "No of outgoing messages per second"
::= { serverconnection 5 }
----------------------------------------------------------------
END
Any help is greatly appreciated. I am a beginner in SNMP.
My article on a reference-counted smart pointer that supports polymorphic objects and raw pointers
modified 29-Aug-18 21:01pm.
|
|
|
|
|
I have some code that does great:
CMenu* mmenu = ((CMainFrame*)AfxGetMainWnd())->GetMenu();
int pos = ((CMainFrame*)AfxGetMainWnd())->FindMenuItem(mmenu, "test dyn");
CMenu* submenu = mmenu->GetSubMenu(pos);
pos = ((CMainFrame*)AfxGetMainWnd())->FindMenuItem(submenu, "junk");
CMenu * flyOutMenu;
flyOutMenu->CreatePopupMenu();
<code>flyOutMenu->AppendMenu(MF_STRING, 0, "From View 1 butto");
pos = ((CMainFrame*)AfxGetMainWnd())->FindMenuItem(submenu, "junk");
submenu->ModifyMenu(pos,MF_BYPOSITION|MF_POPUP,(int)(flyOutMenu->m_hMenu),"&File");
submenu->AppendMenu(MF_POPUP,(int)(flyOutMenu->m_hMenu),"&File1");</code>
Now if I replace the section in red by the foll. it crashes at flyOutMenu->CreatePopupMenu(); !!!!! It doesnt even get to the replacement code. What have I done wrong?
CBKDoc * pDoc = (CBKDoc *)GetDocument();
DynaMenuMap::iterator itDyn = (pDoc->dynaMenuMap).begin();
for (; itDyn != (pDoc->dynaMenuMap).end(); itDyn++)
{
char * tempDyn;
CString tempCDyn = (*itDyn).first;
tempDyn = new char [tempCDyn.GetLength() + 1];
strcpy(tempDyn, tempCDyn);
SubMenuSet& subMenuSet = (pDoc->dynaMenuMap)[tempCDyn];
SubMenuSet::iterator itSub = subMenuSet.begin();
for (; itSub != subMenuSet.end(); itSub++)
{
char * tempSub;
CString tempCSub = *itSub;
tempSub = new char [tempCSub.GetLength() + 1];
strcpy(tempSub, tempCSub);
flyOutMenu->AppendMenu(MF_STRING, 0, tempSub);
delete tempSub;
}
if ( itDyn == pDoc->dynaMenuMap.begin())
{
submenu->ModifyMenu(pos,MF_BYPOSITION|MF_POPUP,(int)(flyOutMenu->m_hMenu),tempDyn);
}
else
{
submenu->AppendMenu(MF_POPUP,(int)(flyOutMenu->m_hMenu),tempDyn);
}
}
Appreciate your help,
ns
|
|
|
|
|
I'm pretty darn sure this is not good:
<br />
CMenu * flyOutMenu; <br />
flyOutMenu->CreatePopupMenu();<br />
since "flyOutMenu" is a pointer that is uninitialized . To fix, rename variable to "pFlyOutMenu" to indicate and remind you it is a pointer ... and change code to:
<br />
CMenu * pFlyOutMenu = new CMenu; <br />
if (pFlyOutMenu)<br />
{<br />
pFlyOutMenu->CreatePopupMenu();<br />
:<br />
:<br />
:<br />
pFlyOutMenu->DestroyMenu();<br />
delete pFlyOutMenu;<br />
}<br />
I could be wrong of course......
|
|
|
|
|
I have a project and it has two views (same document template used for both). The CBKView1 class has a GetDocument (MFC wrote it), and CBKView2 does not have this function.
YET the code compiles if I do
CBKDoc * pDoc = (CBKDoc *)GetDocument();
in CBKView2 class!!!!!!
Is this not most peculiar? It actually works too. How can this be?
Appreciate your help,
ns
|
|
|
|
|
GetDocument() just makes use of the pView->m_pDocument member variable. It could also be that the function is defined in a base class (CView etc) so that you don;t need to add it yourself.
Roger Allen
Sonork 100.10016
This is a multiple choice question, choose wisely
Why did the hedgehog cross the road?
A: To show he had guts?
B: To see his flat mate?
|
|
|
|
|
Thanks.
Appreciate your help,
ns
|
|
|
|
|
Remember a while ago, when I was telling you to define this "GetDocument" function in your CBKView2? This is partially why.
Chris Richardson
Programmers find all sorts of ingenious ways to screw ourselves over. - Tim Smith
|
|
|
|
|
Indeed I do remember your words and did implement them. It just puzzled me greatly that it worked even if I didnt add GetDocument to CBKVIew2 as well. But yes, as soon as i ran into this facet...........needing the pDoc pointer in the second view, I immediately remembered your post (which is cut and pasted in my hints.doc collection of CP resolutions).
Appreciate your help,
ns
|
|
|
|
|
I have a dynamic submenu being created under a toplevel menu. THese submenus have no ID since I dont know how many there are. So to write handlers for these when clicked, it seems , can be achieved by capturing WM_MENUCOMMAND. BUt I havent figured out how to do this. If it were a resource with ID_MENU_A, then I could of course write the COMMAND handler for it> But I am rather lost in utilizing WM_MENUCOMMAND:
How to trrap it?
What all needs to be added to the code to get this to work?
THanks,
Appreciate your help,
ns
|
|
|
|
|
You may perhaps not know a specific value, but perhaps can you know the range of the IDs.
ON_COMMAND_RANGE(ID_MENU_START, ID_MENU_END, OnMenuRange)<br />
ON_UPDATE_COMMAND_UI_RANGE(ID_MENU_START, ID_MENU_END, OnUpdateMenuRange)
HTH,
Angels banished from heaven have no choice but to become demons
Cowboy Bebop
|
|
|
|
|
The menu keeps getting redone all the time. Lets say I have a maximum of 200 items I could possibly want. Then
if I put ID_MENU_START = 5000, and ID_MENU_END = ID_MENU_START + 200
(BTW how does one decide what number to assign to ID_MENU_START?)
Then if at a certain time I have only 50 menu items and I click one, then will the function OnMenuRange run without crashing?
i.e since the remaining 150 dont exist is that a problem?
The other question is: what if I needed a different handler to run for each menu item? ? I have no IDs
Appreciate your help,
ns
|
|
|
|
|
ns wrote:
BTW how does one decide what number to assign to ID_MENU_START?
Take a look in your apps resource.h file and assign it there. Also make sure that none of the id's in the range are being used for anything else.
ns wrote:
Then if at a certain time I have only 50 menu items and I click one, then will the function OnMenuRange run without crashing?
This should be fine. The OnUpdateUI and OnCommand handlers only get called if the menu item actually exists. You can also tell for which item it is for by the parameter that is passed to the function. Just make sure you get the function prototypes right, as they are not done by class-wizard and have to be done manually.
ns wrote:
what if I needed a different handler to run for each menu item? ? I have no IDs
Farm the OnRanegCommand() id out to the correct function in this handler by looking at the command id passed to you.
Roger Allen
Sonork 100.10016
This is a multiple choice question, choose wisely
Why did the hedgehog cross the road?
A: To show he had guts?
B: To see his flat mate?
|
|
|
|
|
Thanks !!
Troubling point: . Very luckily I found the prototype for the ON_COMMAND_RANGE handler in one of my books. I looked on the web , and found one place that showed me too. But MSDN didnt have a prototype under the index word ON_COMMAND_RANGE. Most of my books didnt have the prototype either.
Your respoinse was very informative and answered my questions very well. Thank you again.
Appreciate your help,
ns
|
|
|
|
|
This article[^] should help you
K.
Angels banished from heaven have no choice but to become demons
Cowboy Bebop
|
|
|
|
|
Thats a terrific link!!! MAny thanks for your input!
Appreciate your help,
ns
|
|
|
|
|
I "upgraded" to VS.net and I'm having trouble doing things that used to be simple...(I know, I'm old etc etc) I have to add a combobox to a property page in an existing modless dialog application ( built using Visual Studio & VC++ 6.0 )but my frustration level is about to blow! Do I need to go back to my old VS to get this done? What happened to my friend the Class Wizard??? Is there someplace that I can walk through the process of adding a dropdownlist with two items to my existing code?
Frustrated & cold ( it's 14 below today );P
The world is run by those who show up...and they usually have nothing else to do!
|
|
|
|