|
i got 1 function OnButton();
(1) Upload file
(2) Download list
(3) write file list (update with new filename)
(4) Upload updated list
and while i can see (with my eyes) that list got one more line my reader cant see that
|
|
|
|
|
We are using the XListCtrl from code project and would like to have multiple lines in a column for tool tips. I have tried \r\n and I have looked at some other information in code project and else where. When a particular row/column has the mouse over it to have a tool tip appear but possible have multiple lines. the lines could be 80+ characters if we could. Could someone point me to a simple and quick solution?
thank you
|
|
|
|
|
I use "\n" for a newline in balloon tooltips. Not sure if this works for standard but I thought I'd post it in case you hadn't tried it yet.
-- modified at 23:54 Monday 29th May, 2006
I just verified that it works for both types of tooltip...
m_ToolTip.Create(this,TTS_BALLOON); // Balloon
m_ToolTip.Create(this); //for no balloon
|
|
|
|
|
bob16972 wrote: Not sure if this works for standard but I thought I'd post it in case you hadn't tried it yet.
its not working!!!
SaRath
"D on't blindly follow rules you read somewhere without verifying that it makes sense for your situation!"
|
|
|
|
|
What does the XListCtrl use for it's tooltips? I would have guessed it used CToolTipCtrl internally but I guess not.
Sorry about the misinformation then. That'll teach me to make assumptions.
|
|
|
|
|
bob16972 wrote: What does the XListCtrl use for it's tooltips?
In XListCtrl too it has normal tool tip, ther is no tool wrapped text inside the tooltip. I have tried in XListCtrl too by putting "\n" and "\r\n" to make the text wrap. but I failed to do that
SaRath
"D on't blindly follow rules you read somewhere without verifying that it makes sense for your situation!"
|
|
|
|
|
I have a Check Box and a OnTimer
while i run my application , when i press the Check Box it get the TRUE (looks as checked) but after 2 sec (OnTimer tick) it is become unchecked (FALSE)
Any way to avoid that?
|
|
|
|
|
What I guess is that you have called the funtion
UpdateData in the OnTimer funtion.
check for that.
Regards
Anil
|
|
|
|
|
hmm...I think so...
|
|
|
|
|
Immunity18 wrote: hen i press the Check Box it get the TRUE (looks as checked) but after 2 sec (OnTimer tick) it is become unchecked (FALSE)
Handle On CLick Event on The CheckBox and Call UpdateDate(TRUE);
"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
Support CRY- Child Relief and You
|
|
|
|
|
I beg your pardon in advance for asking such a question.
How do I save the contents of the Rich Edit View that a user types? Is there a variable that holds this information or do I have to create it - if so how?
Also, how do I send text out to the Rich Edit View? I tried to get a Device Context then use dc.TextOut(...) but it didn't work. Any ideas?
Thanks in advance,
BP
-- modified at 17:33 Monday 29th May, 2006
|
|
|
|
|
|
Hi all,
suppose I have a XML that is represented by the following string:
<tag a="1" b="2">
notice this xml doesn't have the regular xml header ( the tag that begins with <xlms=...>)
if i call the IXMLDOMDocument method loadXML, it fails...i think it is because the string lacks the tag <xmls...>... i heard there is a propery of IXMLDOMDocument i can set that it won't need the tag <xmls..>...but i don't know what it is
can some1 help?
thanks in advanced
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
Hi
The LoadXML funtion fails if the XML is having error. In your case there is no end to the tag you provide.
Load any one of <tag a="1" b="2"></tag> or <tag a="1" b="2"/> and hope you won't have problem; though I haven't tested it myself.
Regards
Anil
-- modified at 20:21 Monday 29th May, 2006
|
|
|
|
|
i do have a closure tag. that is not the problem....
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
Ok if this is the case I want to confirm one more thing.
Since you are using IXMLDOMDocument, have you initialize the pointer with statement like this?
SUCCEEDED (CoCreateInstance(CLSID_DOMDocument,
NULL,
CLSCTX_INPROC_SERVER,
IID_IXMLDOMDocument,
reinterpret_cast<void**>(&m_pDoc))));
m_pDoc->loadXML("<a></a>");
Regards
Anil
|
|
|
|
|
yes i did
i know there is a IXMLDOMParseErrorPtr object which i can get the error that has occurred but i can't seem to get it properly....
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
the bellow code working fine with me.
IXMLDOMDocument *m_pDoc;
m_pDoc = NULL;
if ( SUCCEEDED (CoCreateInstance(CLSID_DOMDocument,
NULL,
CLSCTX_INPROC_SERVER,
IID_IXMLDOMDocument,
reinterpret_cast<void**>(&m_pDoc))))
{
m_pDoc->loadXML("<a></a>");
}
and also the bellow code
{
HRESULT hResult = E_FAIL;
long lErrorCode = E_FAIL;
IXMLDOMParseError *pXMLError = NULL;
if (SUCCEEDED(m_pDoc->get_parseError(&pXMLError))
&& SUCCEEDED(pXMLError->get_errorCode(&lErrorCode))
&& ( lErrorCode != 0 ) )
{
// do some error report procedure
}
//
// Clean-up pointers used.
//
if ( pXMLError )
{
pXMLError->Release();
pXMLError = NULL;
}
//
// Pass back the return code.
//
return lErrorCode;
}
Regards
Anil
|
|
|
|
|
YaronNir wrote: i know there is a IXMLDOMParseErrorPtr object which i can get the error that has occurred but i can't seem to get it properly....
What is the error?
"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
Support CRY- Child Relief and You
|
|
|
|
|
What type of string are you trying to load the DOM with?
|
|
|
|
|
CString which is cast to _bstr_
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
Regarding the null terminating character being embedded within a source/custom resource (input string) , I'm having some difficulty getting fwrite to continue past embedded 0x00 values in my data...
Someone posted elsewhere on this site:
It acted like it continued beyond the end of the array until it came across the zero byte in memory. I put the "\0" or the 0x00 and it stopped exactly where I told it too. This raises the question, if that array is supposedly a hex representation of an exe, how are you getting away without stumbling across 0x00 somewhere in the binary string? this is one of the reason they tell us to encode binary data when using a null terminated string to contain it.
My code:
CODE
char * cStr = reinterpret_cast< char *>(lpVoid);
cStr = strncat(cStr, "\0", 1);
printf("size of cStr%d\n", sizeof(cStr));
FILE * stream;
if( (stream = fopen( "fread.out", "w" )) != NULL )
{
int num_write = 0;
num_write = fwrite( cStr, sizeof( cStr ), 1, stream );
printf( "Wrote items: %d\n", num_write );
fclose( stream );
}
Results:
follwing were writing sizeof(cStr) - 1 (not wanting to write the trailing null to our output file):
testing: 4d 5a 90 as input, output: 4d 5a 90 (OK)
testing: 4d 5a 90 00 as input, output: 4d 5a 90
testing: 4d 5a 90 00 03 as input, output: 4d 5a 90
testing: 4d 5a 90 03 as input: output: 4d 5a 90
writing sizeof(cStr) :
4d 5a 90 -> 4d 5a 90 00
4d 5a 90 00 -> 4d 5a 90 00
4d 5a 90 00 03 -> 4d 5a 90 00 (stripped trailing character)
Anyone have any suggestions on how to proceed?
How will the program know the difference between the trailing null at the end of the string versus embedded nulls?
|
|
|
|
|
There are two problems. First, cStr is a pointer, so sizeof(cStr) will always be 4 no matter what it's pointing to.
Second, strncat(cStr, "\0", 1) has no effect. A \0 character marks the end of a string, so "\0" is the same as "" , a string with zero length.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
If this is an exe file that your trying to place into some null terminated string, you will probably need to hex encode or base64 encode it so that no nulls appear.
BSTR comes to mind but I've never used them for binary data but it's supposed to be useful for that.
If your into COM, you can use CreateStreamOnHGlobal. I use it when Decoding Base64 encoded binary data to temporarily hold the byte stream before I load a GDI+ image object with the data stream. GetHGlobalFromStream works nicely with CArchive::Write so you can serialize to and from disk with having to deal with strings.
It takes about a weeks effort to build a fairly nice reusable class. But it's worth it if your going to be working with binary streams often. The book "Essential COM" by Don Box has a short but adequate section on it not to mention fairly decent coverage of COM (if there really is such a thing)
|
|
|
|
|