|
Hi,
I have a task, where i need to traverse the items of a tree by pressing the ctrl key with up arrow and down arrow and on clicking ctrl+space bar i shall select the items.
I could select the first item in a tree with Ctrl+left mouse click.The Functionality for selecting the items with ctrl+mouse has already been implemented.
when I press Ctrl+down/up arrow i want the item to be focussed(the thin border that appears) but not selected and it should be selected only when i press ctrl+space bar.
And upon on pressing the the ctrl+down arrow more than two times and selecting another item with ctrl+spacebar , is there any function with which i can get the first selected item so that i can store their information .
Thanks
|
|
|
|
|
I have code like this:
class A
{
};
class B:public A
{
public:
CString m_b;
};
class C
{
A p_A ;
C(){p_A = new B();};
~C(){delete p_A;};
void fun()
{
AfxMessageBox(p_A->m_b);
};
}
how can I access the members of B from the pointer of A?
Thank you very much!!!
-------------------
I am learning C++ and English
|
|
|
|
|
One problem with your code is the statement
p_A = new B(); is incorrect since p_A is not declared as a pointer variable.
So p_A should be declared as A * p_A
Then you can use type casting to change the object of type A to a object of B before accessing the member variable m_b
So the correct version of the code is as follows
class A<br />
{<br />
};<br />
class B:public A<br />
{<br />
public:<br />
CString m_b;<br />
B(){<br />
}<br />
<br />
};<br />
<br />
class C<br />
{<br />
public :<br />
A* p_A ;
C(){<br />
p_A = new B();<br />
}<br />
~C(){<br />
delete p_A;<br />
}<br />
<br />
void fun()<br />
{<br />
AfxMessageBox(((B*)p_A)->m_b);
}<br />
};
|
|
|
|
|
the ending cast you make in the message box is not necessary...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
You may want to reflect on that statement a bit.
[EDIT]
toxcct : the ending cast you make in the message box is not necessary...
I don't know why this was voted 1.
I was trying to (politely) point out that this is incorrect.
You do need the cast.
[/EDIT]
...cmk
Save the whales - collect the whole set
-- modified at 2:41 Wednesday 16th November, 2005
|
|
|
|
|
hello,
how do i copy a selected part of a view to another view using mfc....(if i use a mouse to select a part of view using a mouse the selcted part should be displayed on another view (inside a dialog box))
yog
|
|
|
|
|
Hi,
I'm using a CDialogBar in my App, but i have a problem using it (CDialogBar) :
when i add a button to my DialogBar Resoure.
When i run my app, buttons on my CDialogBar always apear disabled (I'm sure that i have not change the state Visible or Disable).
when i debug to see if they are disabled or not , i found that they are not disabled
BOOL b = GetDlgItem(IDC_MY_BUTTON)->IsWindowEnabled();
result (b = TRUE) but visualy button is Disabled !!!!!!!!!!!!
this happen just with buttons.
INew.
thanks a lot.
inew
|
|
|
|
|
I think "enabled" means it's visible, not that it is interactable with the user. When I want to hide controls, I use their EnableWindow() method to make them invisible.
|
|
|
|
|
|
Hi every one,
I'm a new commer. I'm doing a project about the fingerprint system. I have a sensor ( MBF200 ) to capture the fingerprint image and send it to my PC via COMPort. The data which is sent from sensor is a matrix of 256 rows and 300 columns, in which each elements is one byte ( gray scale value ) with a range from 0 to 255. This sensor only can take a gray image ( not a color Image ).
Now, I want to write a program for receiving that data, save that image in BMP format ( *.bmp ) and show it on the PC screen. I'm using Visual C++ lanuage and the MSCOmm control for accessing to Comport. My operating system is microsoft Windows 98 ( Second edition ). How can I do that ? Please help me !
Thank you.
|
|
|
|
|
Use the sensor's SDK in the VC++ app to get and display the image.
Bye
Cool Ju
|
|
|
|
|
Normally I know how to set breakpoints and use breakpoints.I got a VC++ sample code from disk.When I set breakpoints and debug it,it show the following messages:One or more breakpoints cannot be set and have been disabled and the application will stop at the beginning of the program.Please tell me how to solve this problem .
Thank you very much for your answer!
sude
|
|
|
|
|
sude wrote: Normally I know how to set breakpoints and use breakpoints.I got a VC++ sample code from disk.When I set breakpoints and debug it,it show the following messages:One or more breakpoints cannot be set and have been disabled and the application will stop at the beginning of the program.Please tell me how to solve this problem .
Looks like you are running in Release mode. Change the build configuration to Debug mode.
|
|
|
|
|
I try to change the configration ,but it did not work.I hope to get a good solution.
su
|
|
|
|
|
How can i ban a Host or IP address before i do my accept() call ?
Can i pool the connection queue ?
Now im doing this:
accept->check for valid IP->If it's valid(do nothing)else->close the socket.
i belive this can be a bit insecure i dont really know.
I what to call my checking routine before doing the accept() any ideas ?
-- modified at 19:16 Sunday 13th November, 2005
|
|
|
|
|
It would probably be better to do this at the firewall level.
|
|
|
|
|
|
sunit5 wrote: ForumVisual C++
Subject:Re: IP/Host baning
Sender:sunit5
Date :35 14 Nov '05
U can go for SSL Socket
Bu buddy you have to make he call for Accept() function before checking is this connection coming from valid ip
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
benjamin23 wrote: How can i ban a Host or IP address before i do my accept() call ?
Which class are you using? If you’re using CAsyncSocket then have you looked into over riding OnConnect? I dont have any code handy but there is a chapter in Secure Coding about doing this.
(if I remember I will try and look up the santax when I get home)
DEBUGGING : Removing the needles from the haystack.
|
|
|
|
|
|
[LPCONDITIONPROC lpfnCondition]
Procedure instance address of the optional, application-specified condition function that will make an accept/reject decision based on the caller information passed in as parameters, and optionally create or join a socket group by assigning an appropriate value to the result parameter g of this function.
defines a callback its a verry intresting option but not code samples are supplied by MS any ideas ?
|
|
|
|
|
Hi evey1,
I am working on a dll addon for an app1 where i need to retrieve some info from app2. but the app2 sdk allows only to collect data via WM_COPYDATA (it will send you to your window). Now, if I were to make a separate application for this, I would just collect the data from my WindowProc. But here I have to do this from a dll. Also I understand there is no HWND for a dll.
One work around this problem i am thinking of is to create a hidden window from the dll and use its windowproc to handle WM_COPYDATA. But is there any other easier way to do this? I am not using MFC but might consider using MFC if this can be done easily. Thanks in advance ppl.
- tareq
of all the things i've lost, i miss my mind the most
|
|
|
|
|
Your idea of creating a hidden window from the DLL is the right way to do this.
|
|
|
|
|
thanks a lot.
- tareq
of all the things i've lost, i miss my mind the most
|
|
|
|
|
I know it's not VC++ but I'm trying to capture video with my camera and i'm using the vfw.h header file. After I got done adding the functions that were not in the header (Using MSDN Library) i tried to compile the program but i get a link error with undefined references to the functions i added. I looked all over the internet to find out why i would get the link error, but it still won't work even after doing what some pages said. Can anyone help me with this problem?
Thanks in advance,
me...;P
|
|
|
|