|
Not totally sure, but I think P/Invoke only supports "C" linkage.
That means you can call exported functions but not exported classes.
If so, you will need to create a wrapper in C++ that export only functions and these functions can delegate function calls to the C++ class.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Thanks for the info. I'll check out using a wrapper. It would be nice if I can get the class exported also.
|
|
|
|
|
what is the exact code to get the value of the editbox (variable type double) and displays in the listbox?
i tried : m_list.GetText(m_list.GetCurSel(), m_edit1) and m_list.GetText(m_edit1) but after building committed errors...
please help.
|
|
|
|
|
Neil Jigger wrote: what is the exact code to get the value of the editbox (variable type double) and displays in the listbox?
CString str;
m_edit.GetWindowText(str);
m_listbox.AddString(str);
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
--------------------Configuration: g - Win32 Debug--------------------
Compiling...
gDlg.cpp
C:\Program Files\Microsoft Visual Studio\MyProjects\g\gDlg.cpp(179) : error C2039: 'GetWindowTextA' : is not a member of 'CString'
c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(368) : see declaration of 'CString'
Error executing cl.exe.
g.exe - 1 error(s), 0 warning(s)
still i cannot get the right code...
|
|
|
|
|
Yes.. SetWindowText is not a member of CString.
I assume you are using a textbox. make a variable of control type.
Something like this
CEdit m_edit
and then compile the code.Hope this helps.
|
|
|
|
|
Wanting to know how to create payload as a block of binary data for DNS packet.
I have something in C but i was looking to increase the payload size. (test purposes)
|
|
|
|
|
char *buffer;
buffer = new char[bufferSize + extraSize];
sendto(socket, buffer, bufferSize + extraSize, flags, &destAddr, destaddrSize);
1300 calories of pure beef goodness can't be wrong!
|
|
|
|
|
im using Nemesis DNS generator so im going to call the file to be used and within the file are only datatype and i use the %c and %s to identify dateype when formatting the output
fp = fopen ("datafilename.dns"), "w");
fprintf(fp, "%c%c%c%c, 0x00, 0x01 ")
fprintf(fp,"%c%s, 0x03, "www");
etc......
fclose(fp);
your code may do the same but i am not a strong programmer and was wonder if you could explain if you code does what this does and point me to some reading material
|
|
|
|
|
|
|
but like i said, i already created the attack now im trying to generate a bigger one so i will be able to prevent it. you know the gov. created a company who's sole purpose is internet security so i understand that u may think i want this knowledge for ill usage.
|
|
|
|
|
but i will create an algorithm which will solve this problem so remember my user name(s)
|
|
|
|
|
but i will create an algorithm which will solve this problem so remember my user name(s)
|
|
|
|
|
The html content was downloaded from host with security info, such as Credit card number, IP address, user password etc.
I need to display the memory html file directly on a dialog without saving it as temp file for launching by IE or MS-Web-Browser because of security reason (delete file doesn't work always and is dangrous).
Do you know how to do this?
Thanks.
|
|
|
|
|
|
As I posted before, I thought I succeed to change my pointer shapes as I wanted (please see the codes & remember to add in stdAfx.h the #define OEMRESOURCE:
UpdateData(true);
if(m_Type == "ARROW")
SetSystemCursor(LoadCursor(NULL, IDC_ARROW), OCR_NORMAL);
else if(m_Type == "ALLSIZE")
SetSystemCursor(LoadCursor(NULL, IDC_SIZEALL), OCR_NORMAL);
else if(m_Type == "UPDOWN")
SetSystemCursor(LoadCursor(NULL, IDC_SIZENS), OCR_NORMAL);
else if(m_Type == "UP")
SetSystemCursor(LoadCursor(NULL, IDC_UPARROW), OCR_NORMAL);
UpdateData(false);
- The first time all working as I wanted, but after that they are mixed-up (rarely the right one, most of a time showing 1 of 3 other shapes instead)
Can someone show me the correctiuon, thanks in-advanced
|
|
|
|
|
it looks the m_Type is a CString.
CString should be used with care in rare cases.
i.e.
CString cs0="Hello";
CString cs1=cs0;
the cs0 and cs1 share same memory.
CString cs0=5; is also a truble.
I suspect about operator == of CString.
If you change code to
if(m_Type.Compare("XXX")==0)
things shoud be fine.
|
|
|
|
|
Hi
It isn't the case, because I did run the debug & it went into each case as I wanted. I also did try with the number instead & the result is the same
- The symtom is weird (please try yourself):
. The pointer did change but not the way I wanted
. Also it appeared different shape between the Desktop & inside any text document
*) I suspect it is mixed-up in the memory (the previous one & the new one), but I don't know how to fix it!
|
|
|
|
|
Is the m_Type variable a CString as suspected by includeh10.
If it is not, what type is it?
If it is a character array, you will need to use the strcmp or wcscmp functions depending on whether the build is UNICODE or NON-UNICODE.
If it is a CString and the build is UNICODE you have to do the comparison as if (m_Type == L"ARROW") .
Ideally m_Type must be an integer variable and all types must be #defined like -
#define ARROW 1<br />
#define ALLSIZE 2<br />
etc.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Hi
It isn't the case, because I did run the debug & it went into each case as I wanted. I also did try with the number instead & the result is the same
- The symtom is weird (please try yourself):
. The pointer did change but not the way I wanted
. Also it appeared <u>different shape</u> between the Desktop & inside any text document
*) I suspect it is mixed-up in the memory (the previous one & the new one), but I don't know how to fix it!
|
|
|
|
|
On further reading the documentation carefully, I found that LoadCursor is the problem.
Here is a snippet from the documentation -
The system destroys hcur by calling the DestroyCursor function. Therefore, hcur cannot be a cursor loaded using the LoadCursor function. To specify a cursor loaded from a resource, copy the cursor using the CopyCursor function, then pass the copy to SetSystemCursor.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Hi,
Thank for suggestion, but I did try with all kind of CopyCursor then passing it to the SetSystemCursor, but the Pointer now is unchanged at all!
I did try to search if anyone can succeed to change the Pointer with VC++ ... but looks like there nothing (well, might be with those link with Chinese language, but I can't read them)
Any further suggestion?
|
|
|
|
|
When using CHtmlView (and using Javascript to get the broswer version), I get version 4( corresponding to IE4 to IE6)... whereas I would like the latest installed version to use...
Does anyone know how/if this is possible?
I am doing this so I can run flash controls in the control - and so that they can call Jasvascript functions... Any pointer for that would be welcome too... it seems only possible in http but not on local files...
Thanks in advance!
Jerome
|
|
|
|
|
BadJerry wrote: using Javascript to get the broswer version
The actual version of the browser is contained in the navigator.userAgent property and is typically extracted with a regular expression. For instance one of my test machines is still running Internet Explorer 6.0. The userAgent field returns the following:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
To extract the version information you can use the following:
var exp = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
var version = 0;
if (null != exp.exec(navigator.userAgent)) {
version = parseFloat( RegExp.$1 )
}
1300 calories of pure beef goodness can't be wrong!
|
|
|
|