|
I know how to do this with a RichEdit control (use the SetEventMask member function).... But I don't know to do the same with an HtmlEdit control !!!!
Could anyone help me?
Thks in advance!
Appstmd
http://www.appstmd.com
|
|
|
|
|
In an MFC application,
I use dialog window in which user give infotmations i store as variable member in the class of the dialog window.
How can I use this variable in an other window ( in the classView for exemple)
It seems that the #include "dialogs.h" is not sufficient
|
|
|
|
|
If it's a private member (I always use private variable members), you have to write a public function that returns the value:
For example if the variable is an int (says int Value) (place it in your header file):
public:<br />
int GetValue() { return Value; }<br />
<br />
private:<br />
int Value;
You can then get your Value in the calling class by calling this function!
Hope this helps
|
|
|
|
|
In the code below packet_handler function is not the member of the
class I want to display the data generating from this function to be displayed on the list box. But handle to the list box is not there as is not the member of the class.
Is there any way I can get handle of listbox into the function p_h
below.
It is important the funtion declaration of "paket_handler" is defined in the library file so the return type or parameter cannot change.
//defined in winpcap library
void sniff::OnButton1() {
pcap_loop(adhandle, 0, packet_handler, NULL);//call to the call back //packet_handler function
}
void packet_handler(u_char *param, const struct pcap_pkthdr *header, const u_char *pkt_data)
{
ih = (ip_header *) (pkt_data + 14); //length of ethernet header
ip_len = (ih->ver_ihl & 0xf) * 4;
......//more code
......
/* print ip addresses and udp ports */
printf("%d.%d.%d.%d -> %d.%d.%d.%d\n",
ih->saddr.byte1,ih->saddr.byte2,ih->saddr.byte3,ih->saddr.byte4,
ih->daddr.byte1,ih->daddr.byte2,ih->daddr.byte3,ih->daddr.byte4);
}
Reply me soon
|
|
|
|
|
I've got some threads I've created ... mm nice
In the thread function should I ExitThread or should I just return?
If I ExitThread, what should I specify for the value if everything is fine?
hThread = CreateThread(
NULL, // no security attributes
0, // 0 = use default stack size
CopyFileFunction, // thread function
this, // argument to thread function
0, // use default creation flags
&dwThreadId); // returns the thread identifier
//
//.............
//
DWORD WINAPI CopyFileFunction(LPVOID lpParam)
{
ExitThread(1);
return 0;
)
|
|
|
|
|
you don't have to call ExitThread() explicitly, but if you use C-runtime functions inside the thread function, you should use _beginthreadex() instead of CreateThread() (otherwise some stack data for certain methods won't be initialized and you might have memory leaks)
|
|
|
|
|
Hi,
I utilize Visual C++ 6.0.
I have develop an application with menus and dialogs in SDI.
I want to transfert it to a MDI application.
There is a way to keep my dialogs and menus and transfer it to the MDI
project ?
Thanks,
Claude
|
|
|
|
|
Hi all,
I'm creating a small application that uses DAO (I know, it's old-fashioned!).
I need to store in a field a text with more than 255 characters. So far I have used:
dbTable.CreateField("Error",dbText,255);
with success, but with the 255 limitation. I tried:
dbTable.CreateField("Error",dbMemo,2048);
but it's still 255-limited.
How can I create a field for a long text?
I'd appreciate any ideas.
Thanks a lot.
-- narada
|
|
|
|
|
Hi,
first of all memo fields do have an initial length of zero.
Then check your UpdateData function, if there is a length restriction.
This can be done by explicitly setting the text length of the control or by DDV_MaxChar(....).
G. Steudtel
|
|
|
|
|
So you don't think this is an Access restriction?
|
|
|
|
|
Visual Studio.NET refuse to compile this. get type cast error
in VS 6 it works.
CGridItem* CMyGridCtrl::GetNextItem( DWORD h )<br />
{<br />
std::vector<CGridItem*>::iterator it;<br />
<br />
it = ( std::vector<CGridItem*>::iterator )h;<br />
<br />
it++;<br />
if( isItemValid( it ) )<br />
return (*it);<br />
return NULL;<br />
}
|
|
|
|
|
Try
it = reinterpret_cast< std::vector::iterator >( h)
as the two types are totally unrelated.
[edit]Or did you try
it = static_cast< std::vector< whatever >::iterator >( h)
with whatever being the type of your vectors datatype.
[/edit]
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
reinterpret_cast didn't work..
The interator is casted to DWORD becouse some of the classes are also used in other projects and types is not known there.
Properly some bad design somewhere. But I don't want and have the time to rewrite tons of code.
This is just one of many type cast problem. But it looks like most of the problem are handles/DWORDs getting casted to interators.
|
|
|
|
|
yes
Cut and Paste Error..
it should say
it = static_cast< std::vector< CGridItem* >::iterator >( h)
nothing works. strange..
|
|
|
|
|
Problem has been solved. I think..
On VS6 I'm using SGi STL instead of the one included by MS in VS6..
But in VS.NET I was using the provided.
But when I changed so SGI STL is used in VS.NET those compile error went away
But I get some strange warnings instead on other stuff. But I think I can ignore them. Looks like the program is working now.
|
|
|
|
|
Hi,
In one of my project, I am plotting the line for some trajectory, in addition to this I want to show a blinking object at the beginning of the trajectory. I tried creating a bitmap (8 x 8) and tried to put it on the screen with BitBlt function in VC, but it's disturbing the line plotted. It should not distrub the plotted things, How to do it?? Can anybody give some idea or some code??
Regards
Satya
|
|
|
|
|
Could you use an OS caret to do this? Use CreateCaret() and set the height/width of it and position at the start of your tradjectory.
May so what you need and then the OS can handle all the drawing stuff for you.
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
I need to insert a very large number of items into a CTreeView derived control. This insertion takes a long time, so I am doing is asynchronously.
My problem is: whenever I call InsertItem, the tree selection jumps to the newly inserted item. I want to prevent this, so that my user sees the tree being built, but is able to select an item in the tree and have the selection remain on that item.
How would I go about doing this? I tried looking for and using different window styles, and I tried intercepting the TVN_SELCHANGED and TVN_SELCHANGING messages, but wasn't quite able to achieve anything...
I want it to behave sort of like IE does when you open a huge (and I mean HUGE, as in 1MB) XML file.... IE parses the file in the background, and keeps adding new nodes to it, but you are able to view whichever part of the document (that has already been loaded you want).
Thanks,
-CD
|
|
|
|
|
One solution is to keep a reference of the current selected item. Upon inserting new items, call TreeView_Select().
Kuphryn
|
|
|
|
|
The problem was that after inserting each item, there was a call to Expand(), which caused the treeview to scroll to the newly expanded icon. This did not have any visible effect when the tree was being populated off-screen, but once I started doing this in a separate thread after showing the treeview, it was apparent in the tree jumping all over the place.
It turns out (this is code I inherited from someone else at my company) that the proper thing to do, instead of calling Expand() after inserting each item, is to set the State bits (and the mask bits) in the TVINSERTSTRUCT before inserting the item, this causes it to be expanded when it is inserted, without the tree scrolling to it.
Thanks anyway for your help.
|
|
|
|
|
How do you set the dropped height of a CComboBox that is created dynamically?
|
|
|
|
|
MoveWindow() is what you need. Move the window to the area the combo needs and the drop area. The combo will only use the top part when the drop area is not shown. When the drop area is shown, this will expand down to the window coordinates specified in the MoveWindow() call.
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
Hi,
Because of dependencies to external software (and their SDKs) that uses MFC4.2 in old versions of their software and MFC7.0 in newer version I have to compile two versions of my software, one under MFC4.2 and one version under MFC7.0.
Is there any way that I can accomplish this without maintaining separate dsw and sln files?
Is there any way of setting up my project to use another compiler/linker?
Thankful for any help,
Johannes
|
|
|
|
|
HI,
I have a problem concerning MFC with visual C++ 6.0
I want to insert item in a Tree. This Item will be selected via a menu which will open a window for the item selection. that is for the context!
I have problem of classes and i don't understang very well which classes must I choose for my differents window. Could you help me ?
For the tree which is in a the main window i choose a form view
and for the others windows ( for item selections) i create my own class.
But it doesn't work.
Sorry for mistakes,
i am french
|
|
|
|
|
Hi!
I have to write an application, which should communicate over a Bluetooth dongle for USB. Since I never wrote any drivers or such hardware based applications before, I have no idea how to handle this. The MSDN only offers information for Windows CE, but this application should run under Windows 2000.
Can anyone help me???
|
|
|
|