|
Hey John, the OP was talking about the task list inside the Visual Studio IDE
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
I've encountered the same problem, it happens occasionally and just as you said, closing and reopening the IDE seems to get rid of it. Don't know why it happens though
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
hi
i'm trying to make my app to sit in the Physical Memory ?
i read an article from microsoft and it said that i can get PhysicalMemory by using VirtualAlloc which returns my a range of adresses of memory
how can i put in this range an object?
how can i make my application to sit in this range?
or by any other way?
(may be somthing with working set ?? )
|
|
|
|
|
You need to do some more reading: VirtualAlloc() is essentialy used to reserve (a number of virtual memory pages [range of memory]) memory for your applications use. Then you can use VirtualAlloc() to commit individual pages, without consuming physical storage until it is needed.
In other words, it does not allocate physical memory directly!
As for your app sitting in physical memory: it probably does (while running), unless it is rediculously large. The only time the whole of your program is not in physical memory is when it is to large or some other program is active and it needs the physical memory space.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
VirtualAlloc doesn't make your app sit in physical memory. It simply reserves and/or commits a range of virtual addresses for you. You might want to take a look at the VirtualLock function, but are you sure your app absolutely needs to be in physical memory?
how can i put in this range an object?
VirtualAlloc simply returns a void*, you can have an array of structs which have a pointer to the starting address of the region and the region size, if you want to.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hello all,
I have CAsyncSocket class I have rewritten the virtual member function OnReceive:
void CCommunication::OnReceive( int nErrorCode )
{
if( nErrorCode == WSAENETDOWN ){
ASSERT( 0 );
return;
}
// do my useful task
// parent
CAsyncSocket::OnReceive( nErrorCode );
}
This clas is used in main dialog window.
Sometimes I am loosing packets ... Why?
All packets are on the ethernet but I dont receive some of them. For example: There are 4 packets on the ETH but I receive only first three.
This happens about three seconds after application start on Cel.900MHz@256MbRAM, and when I drag the main window by the title bar on the SempronMobile 3000+@704MbRAM
The application is MFC dialog based. The communication is UDP.
Thank you for any suggestion ...
xSoptik
|
|
|
|
|
|
Hello all,
I would like to change window size by the actual string size. The string size deplend on the actual font.
I am not able to get actual string lenght in pixels ...
Do you now any function that returns actual string length in pixels?
thank you for any advice
|
|
|
|
|
The GetTextExtent... functions will do that.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
Hey everybody. Does anybody got a clue why this code doesn't work? I wanted to simply create a string with that number in it, without using sprintf.
void Test (long lSomeValue)<br />
{<br />
char *cValue = (char*)malloc(15);<br />
char *cText = (char*)malloc(50);<br />
<br />
cText = "The number is: ";<br />
_ltoa(lSomeValue, cValue, 10);<br />
strcat(cText, cValue);<br />
MessageBox(0, cText, "bla", 0);
}<br />
Test(10);
So how can I do this without using sprintf? And without using CString class.
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
Axonn Echysttas wrote:
void Test (long lSomeValue)
{
char *cValue = (char*)malloc(15);
char *cText = (char*)malloc(50);
cText and cValue are pointers. Right now they point to the memory locations returned by the malloc function.
Axonn Echysttas wrote:
cText = "The number is: ";
cText now points to a different memory location then it did before. It now points to a static memory containing the text "The number is: ". To actually copy the text into the memory that was allocated with malloc you have to use strcpy()
strcpy (cText, "The number is: ");
Axonn Echysttas wrote:
_ltoa(lSomeValue, cValue, 10);
strcat(cText, cValue);
Here the strcat function will fail, most likely with an access violation, because the memory pointed to by cText is readonly memory.
To see this happen, run the program in the debugger, and step through the Test() function, watching the values of cValue and CText as you go. The debugger will give you the memory address pointed to be the pointers, followed by the text contained in that memory. Note the addresses that are assigned by the malloc calls. Now see how when you call cText = "The Number is: "; the address that cText points to changes well as the text, but when you call _ltoa(lsomevalue, cValue, 10); the address that cValue points to remains the same, but the text at that address changes.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
Thanks PJ Arends. This is the second time you pull me out of my misery : D. This question was actually for an article I'm working on... for the Code Project that is. It's about inter-process communication. I hope in 2 weeks it's gonna be done, since I'm not working at it all the time. Anyway... I understand now the memory issue. I'm not such an expert in these things since I started using Visual C++ recently compared to you guys. I'm gonna post a message here when I uploaded that article. But I wrote to the Code Project staff, since I got a user-name problem (lost my old e-mail) and they didn't answer yet. Until they do even if I finish it I won't be able to upload it.
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
1) Do not allocate the buffers (unless you have to). Not only is this bad programing, I see that you do not free them (memory leaks).
2) You are changing the memory address stored in cText from what you allocated to the address of a static string (consisting of only 17 characters[boom - memory leak]).
void Test(long lSomeValue)
{
char cValue[15];
char cText[50] = "The number is: "; // or {"The number is: "};
strcat(cTest,_ltoa(lSomeValue, cValue, 10));
MessageBox(0, cText, "bla", 0);
}
Note (above): No (C) memory allocations was required (every thing is on the stack). The pointer returned by _ltoa() is a pointer to cValue (no error return), so you can combine the two function calls into one.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Thanks John : ). Looks great.
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
I had finished a program,and I want to change the Icon of it.
I copy and past my icon that I had drew in PhotoShop on the icon-drawer of VC++6.0
But... the icon became 16colors-icon
Not only that...The icon of program under some dir is my icon...
but when i put my program under desktop...
very strange... the Icon of program became the icon of MFC
Why?
So... How to change the icon of program...and make the icon won't change when it was put under desktop?
PS: The icon must to be 32bits and larger than 32*32
Thanks a lots!
|
|
|
|
|
Hi,
try to replace the icons in your 'MyProg\res' folder with the new ones.
And never touch any icon with the icon editor of VC++ 6.0
Regards
|
|
|
|
|
Some icons contain two files:
1 file 16x16 icon ( thats for winExplorer )
2 file 32x32 icon ( for desktop and thumbanail view )
If you define icon with only one file, the other will be replaced with built-in icon. So just create two file icon.
CRPG, FRPG, Oblivion Fan
Hater of Counter Strike ( i hate it soo much damn it );
|
|
|
|
|
I need to get input boxes on html web form, I using IHTMLDocument2
<br />
m_pHtmlDoc->get_body(&m_pBody);<br />
CComPtr<IHTMLElementCollection> pForms;<br />
m_pHtmlDoc->get_forms(&pForms);<br />
long lFormLenght = 0;<br />
pForms->get_length(&lFormLenght);<br />
IDispatch *pDispatch = NULL;<br />
for (int i =0 ; i < lFormLenght; i ++ )<br />
{<br />
VARIANT variant;<br />
variant.lVal = i;<br />
variant.vt = VT_I4;<br />
pForms->item(variant, variant, &pDispatch);<br />
CComPtr<IHTMLFormElement> pForm;<br />
<br />
pDispatch->QueryInterface(IID_IHTMLFormElement,(void**)&pForm);<br />
BSTR bstrTemp;<br />
long lLen = 0;<br />
pForm->get_length(&lLen);<br />
CComPtr<IHTMLElement> pElement;<br />
for (int j = 0; j < lLen; j++ )<br />
{<br />
IDispatch *pDispInput = NULL;<br />
VARIANT varInput = {0};<br />
V_I4(&varInput) = j;<br />
<br />
HRESULT hr = pForm->item(varInput, varInput, &pDispInput);<br />
CComPtr<IHTMLInputElement> pInput;<br />
hr = pDispInput->QueryInterface(IID_IHTMLInputElement, (void**)&pInput);<br />
pInput->get_name(&bstrTemp);<br />
pInput->get_value(&bstrTemp);<br />
BSTR bstrNewValue = L"Hello word";<br />
pInput->put_value(bstrNewValue);<br />
pDispInput->Release();<br />
}<br />
}<br />
in string
<br />
hr = pDispInput->QueryInterface(IID_IHTMLInputElement, (void**)&pInput);<br />
in pInput I get only first input box, but on my form two input boxes.
Why I can't get second input box?
|
|
|
|
|
Im using boZoi library to implement Elliptic curve cryptography to my VC project.The functions output r in the format of hexadecimal and OCTETSTR(octant string) now if i want to show the output in the edit box control of a dialog box...???.
ECDSA sig;
HexEncoder hex(sig);
CEdit* poEdit = static_cast<cedit*>(GetDlgItem(IDC_EDIT3));
poEdit->SetWindowText(hex);
HexEncoder is a class which converts to hexadecimal format & i want to convert it converted to CString or LPCTSTR...How i do that?
borZoi can be found at:
http://dragongate-technologies.com/products.html[^]
|
|
|
|
|
|
Yup it worked fine...thanx.But that converts Octant string to Hex String....here i want to convert Hexadecimal to char* or CString to show in edit box....I dont know if the same method can be applied here?
|
|
|
|
|
OK as u suggested i used ostringstream to store hex vaue as a string and then convert it into a CString form to show in the edit control of dialog box.It gives no error but at the time of execution of this code "illegal operation error" message box is displayed.Where Im doing wrong?
std::string s("");
ECDSA sig1(sk, OS2IP(hash)); // generate the signature
DER der_str (sig1); //DER class function
HexEncoder hex_str(der_str); //Hexencoder class function
std::ostringstream str;
str<<hex_str; storing="" hex="" value="" as="" a="" string
s="str.str();
CString" cs="s.c_str();
CEdit*" poedit="static_cast<CEdit*">(GetDlgItem(IDC_EDIT3));
poEdit->SetWindowText(cs);
|
|
|
|
|
OK as u suggested i used ostringstream to store hex vaue as a string and then convert it into a CString form to show in the edit control of dialog box.It gives no error but at the time of execution of this code "illegal operation error" message box is displayed.Where Im doing wrong?
std::string s("");
ECDSA sig1(sk, OS2IP(hash)); // generate the signature
DER der_str (sig1); //DER class function
HexEncoder hex_str(der_str); //Hexencoder class function
std::ostringstream str;
str<<hex_str; storing="" hex="" value="" as="" a="" string
s="str.str();
CString" cs="s.c_str();
CEdit*" poedit="static_cast(GetDlgItem(IDC_EDIT3));
poEdit-">SetWindowText(cs);
Hope ull reply soon.
|
|
|
|
|
titi@yahoo.com wrote:
It gives no error but at the time of execution of this code "illegal operation error" message box is displayed.Where Im doing wrong?
Hard to tell without knowing at what point in the code you get that error.
In any case, if you looked at the DER declaration in borzoi.h, you'd note DER objects hold their data in an OCTETSTR public member named v , and as I already shown you how to code an OctetStrToHexString , you'd realize you can simply use OctetStrToHexString passing der_str.v .
ECDSA sig1(sk, OS2IP(hash));
DER der_str (sig1);
CWnd* pWnd = GetDlgItem(IDC_EDIT3);
if (pWnd)
{
CString sDer;
OctetStrToHexString(der_str.v, sDer);
pWnd->SetWindowText(sDer);
}
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Thnx for (late) reply but ive done it and through the same method as u told.
Since Im stuck in cryptography stuff nad Im using CryptoAPI Ive some data of type BYTE* (PUBLICKEYBLOB)I want to write it in a file then send it across the network and then read from file and use that public key.SIGH!!!!
now to write it in the file i covert BYTE* to CHAR* and then inverse to read ...but to dont get the same value back.
Do u have any better idea to do this??
Thanx again for ur help.
|
|
|
|