|
ok, I just added it to the project and I still get the errors.
|
|
|
|
|
Still the same number of errors, or at least some of the unresolved symbols went away?
Also, you forgot to link with Winsock.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
You must (obviously) link with e.g. the socket library you intend to use, and all the other libraries.
1. Check in the MSDN help what library implements "gethostbyname".
2. Add this to the "Link" tab. You'll have to look up what drop-list tab you need to find for the "libraries" edit box.
3. To that same edit box, add the name (possibly including path) to the library or libraries inplementing e.g. libnet_init_packet.
|
|
|
|
|
ok I just linked with winsock and that reduced the # of errors to ten instead of twelve.
Linking...
arp.obj : error LNK2001: unresolved external symbol "int __cdecl libnet_destroy_packet(unsigned char * *)" (?libnet_destroy_packet@@YAHPAPAE@Z)
arp.obj : error LNK2001: unresolved external symbol "int __cdecl libnet_close_link_interface(struct libnet_link_int *)" (?libnet_close_link_interface@@YAHPAUlibnet_link_int@@@Z)
arp.obj : error LNK2001: unresolved external symbol "int __cdecl libnet_write_link_layer(struct libnet_link_int *,unsigned char const *,unsigned char *,int)" (?libnet_write_link_layer@@YAHPAUlibnet_link_int@@PBEPAEH@Z)
arp.obj : error LNK2001: unresolved external symbol "int __cdecl libnet_build_arp(unsigned short,unsigned short,unsigned char,unsigned char,unsigned short,unsigned char *,unsigned char *,unsigned char *,unsigned char *,unsigned char const *,in
t,unsigned char *)" (?libnet_build_arp@@YAHGGEEGPAE000PBEH0@Z)
arp.obj : error LNK2001: unresolved external symbol "int __cdecl libnet_build_ethernet(unsigned char *,unsigned char *,unsigned short,unsigned char const *,int,unsigned char *)" (?libnet_build_ethernet@@YAHPAE0GPBEH0@Z)
arp.obj : error LNK2001: unresolved external symbol "struct libnet_link_int * __cdecl libnet_open_link_interface(char *,char *)" (?libnet_open_link_interface@@YAPAUlibnet_link_int@@PAD0@Z)
arp.obj : error LNK2001: unresolved external symbol "int __cdecl libnet_select_device(struct sockaddr_in *,unsigned char * *,unsigned char *)" (?libnet_select_device@@YAHPAUsockaddr_in@@PAPAEPAE@Z)
arp.obj : error LNK2001: unresolved external symbol "int __cdecl libnet_init_packet(int,unsigned char * *)" (?libnet_init_packet@@YAHHPAPAE@Z)
arp.obj : error LNK2001: unresolved external symbol "unsigned char * __cdecl libnet_win32_get_remote_mac(unsigned long)" (?libnet_win32_get_remote_mac@@YAPAEK@Z)
Debug/arp.exe : fatal error LNK1120: 9 unresolved externals
Error executing link.exe.
arp.exe - 10 error(s), 0 warning(s)
|
|
|
|
|
I don't understand what's going wrong. I even linked all the libs that Libnet was compiled from.
|
|
|
|
|
Some windows flash (messenger programs does that often to get attention) How can I detect which window is flashing. Maybe with a system wide hook or something?
Does anybody knows this?
-------------------------------
Greetz,
MG
|
|
|
|
|
Short of hooking the kernel (undocumented) and see what windows are told to "flash"? I don't think you can do this.
|
|
|
|
|
Hi.
I have always wondered about having push-buttons at any specific place around the frame in a SDI architecture. I will explain as best I can about how the program might look like. Here is a typical SDI core GUI.
-----
Menu/Toolbar
-----
View
-----
Statusbar
-----
I would like to have something like this:
-----
Menu/Toolbar
-----
View
-----
Two Push-Buttons (Open | Exit) // open and exit is arbitrary
-----
Statusbar
-----
What is the best way to implement something like the GUI above? It is easy to add buttons and such inside a dialog box, but I have never be able to add push-buttons anywhere in the main frame.
I have one idea, but I am not completely sure on how to add the click mesages if the user clicks the button. Three weeks ago I posted a thread asking about added a progress bar insde the status bar. A member at CodeGuru posted a very unique technique that basically enable/disable the default status bar and enable/disable a CControlBar. It was such a cool technique. I am still using it.
I was thinking maybe I can implement the same setup, but this time, enable the CControlbar througout the program's lifetime. However, how will I be able to process messages if the user clicks a button? the use of CControlbar does not require deriving a class to encapsulate the dialog box. Thus, I have no way of processing messages cooresponding to the buttons inside the dialog box.
Do you have a better technique?
Thanks,
Kuphryn
|
|
|
|
|
How about: just another dockable toolbar that contains the buttons, and have the buttons mapped to command IDs (easy handling of the clicks).
Peace!
-=- James.
"Fat people are hard to kidnap."
(Try Check Favorites Sometime!)
|
|
|
|
|
Thanks.
I have thought about a toolbar. However, I am not good with icon graphics and animations. I cannot create an icon that looks like a button. I prefer to use Dialog Editor to create the button. Afterward, I can use the entire dialog box.
I can use a toolbar if there is an easy way to create buttons.
Kuphryn
|
|
|
|
|
Being a toolbar button it will look like a button already! All you have to do is create the image that will sit inside the button.
Peace!
-=- James.
"Fat people are hard to kidnap."
(Try Check Favorites Sometime!)
|
|
|
|
|
Hey Guys
I have declared a structure i created on the freestore in a function. This structure contains pointers which i assign arrays to i then use delete[] on these pointers in the structure to free memory but thsi causes an error.
Any Ideas
Peter
P.S this is my structure
struct SignFileStructure
{
SignFileHeader FileHeader; //Header Structure
//DWORD dwSizeOfFileStruct; //Size of Data Struct
BYTE *psMessage; //Pointer to message array
SignedBlobs *pSignedBlob; //Pointer to array of signed blob pointers
CounterSignedBlobs *pCounterSigBlob; //Pointer to array of counter signed blob pointers
};
and this is my delete[] bit
//Delete all variables used to free memory
//------------------------------------------------------------------------------------------------------------
delete[] SignedFileData.psMessage;
delete[] SignedFileData.pSignedBlob;
delete[] SignedFileData.pCounterSigBlob;
SignedFileData.psMessage = NULL;
SignedFileData.pSignedBlob = NULL;
SignedFileData.pCounterSigBlob = NULL;
//------------------------------------------------------------------------------------------------------------
|
|
|
|
|
How do you allocate these arrays?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
im using the new operator
i then use memset to zero the memory but i can't see that causing a problem
|
|
|
|
|
Do you pass around the structure so that different copies exist? (like vg as a parameter to some function)
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I only ever passed a pointer to it to other functions.
|
|
|
|
|
Then chances are this is an out-of-bounds error. Try for instance doubling the space allocated to see if this masks the error.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Im Lost
How can just passing a pointer to other functions cause an out of bound error
Peter
|
|
|
|
|
Peter Liddle wrote:
How can just passing a pointer to other functions cause an out of bound error
By having that function do something stupid with the pointer!
What Kind of error are you getting when you call delete[] ? And are you sure that all of the memory being freed with delete[] was alocated with new[] ?
Peace!
-=- James.
"Fat people are hard to kidnap."
(Try Check Favorites Sometime!)
|
|
|
|
|
Hi.
I will design and implement a property sheet for a small program I am working on. I have access to Jeff Prosise's example from his book. However, he does not explain the process of linking the property sheet and property pages to their cooresponding dialog boxes.
For example, let say I would like a property sheet with two property pages. I am not sure how to go about linking them to the dialog boxs.
The following questions apply to the sample dialog box I mentioned above (property sheet w/ 2 property pages).
1) How many dialog boxes do I have to create using Dialog Editor? Two or three? Is the property sheet alone considered a dialog box and I have to *create an empty dialog box to serve as the property sheet*?
2) For each dialog box, how do I create them such that they are the same sizes? Do I just eyeball their sizes or their sizes will be based on the size of the property sheet (given you have to create a dialog box for the property sheet).
3) Is it possible to use ClassWizard to implement the classes for the property sheet and property pages?
Thanks,
Kuphryn
|
|
|
|
|
kuphryn wrote:
How many dialog boxes do I have to create using Dialog Editor?
2
kuphryn wrote:
For each dialog box, how do I create them such that they are the same sizes?
doesn't matter. the sheet will size itself to fit
kuphryn wrote:
Is it possible to use ClassWizard
yes. completely.
open the resource editor, right click on the dialog folder, choose "Insert...". this brings up the "Insert resource" dialog. open the "dialog" node, and choose one of the property page sizes (just pick one, you can size them later if you want). add your controls, etc. open the class wizard, add a new class with base class CPropertyPage. do this for each page.
then,to show the property sheet, do something like this:
CPropertySheet mySheet;
CMyFirstPropPage page1;
CMySecondPropPage page2;
mySheet.AddPage(page1);
mySheet.AddPage(page2);
mySheet.DoModal();
you don't really have to do anything with the sheet, just add pages and call DoModal.
-c
There ain't no second chance
Against the thing with the forty eyes
|
|
|
|
|
1) As many dialog boxes as property pages. The property sheet gets created automatically.
2) If they're not the same size, the property sheet will adjust to the greatest dimensions. Usually, the final look is OK. If you're anal (sorry) about margins being perfectly asjusted, try to match all dimensions by hand, or do multiple copies of one of the pages and work on the copies to construct the remaining pages.
3) When adding a class to the dialog box resource, select CPropertyPage as the base class.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Nice! MFC makes creating the property pages similar.
I assume I will create a new class derived from CPropertySheet and instantiates the property pages. Correct?
Kuphryn
|
|
|
|
|
no. just instantiate a CPropertySheet object and add your pages to it (just like my little sample code does). unless you need to change the default sheet behavior you don't need to create a new class for it.
-c
There ain't no second chance
Against the thing with the forty eyes
|
|
|
|
|
Okay.
In his book, Jeff Prosise implements an Apply button. I am not sure if he creates it via deriving a class from CPropertySheet or CPropertySheet comes default with it.
Kuphryn
|
|
|
|