|
Can you post relevent code ?
|
|
|
|
|
DBORDINAL* pulColumns;
DBCOLUMNINFO** ppColumnInfo;
LPOLESTR* ppStrings;
HRESULT h = SomeTable.GetColumnInfo(&pulColumns, &ppColumnInfo, &ppStrings);
SomeTable is of CTable.
ppColumnInfo[index].ulColumnSize returns 1162690894
It should be less than or equal to 255.
|
|
|
|
|
Ordinal wrote: DBORDINAL* pulColumns;
DBCOLUMNINFO** ppColumnInfo;
LPOLESTR* ppStrings;
HRESULT h = SomeTable.GetColumnInfo(&pulColumns, &ppColumnInfo, &ppStrings);
How this code is compiling ?
Shouldn't this be like this ?
UINT pulColumns;
DBCOLUMNINFO* ppColumnInfo = NULL;
LPOLESTR ppStrings = NULL;
HRESULT h = SomeTable.GetColumnInfo(&pulColumns, &ppColumnInfo, &ppStrings);
|
|
|
|
|
I am sorry. U r right.
Anyways what may be the problem?
|
|
|
|
|
From your original post
HRESULT h = SomeTable.GetColumnInfo(&pulColumns, &ppColumnInfo, &ppStrings);
SomeTable is of CTable.
ppColumnInfo[index].ulColumnSize returns 1162690894
Are you sure index value is less than no. of columns returned ?
You should have used this loop,
for (ULONG iCol=0; iCol < cCol; iCol++)
{
|
|
|
|
|
Hi all,
How would one go about achiving the following:
Lets say you use printf and you want to display a message with a counter, but the message must not repeat itself but the counter must. The same question for achiving this in a messagebox.
It it possible?
Thanx agian
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
sorry, i don't really understand. can you provide a bit more detailed infos on your need ?
|
|
|
|
|
Sure,
Something like:
int x=0;
while (x<10)
{
printf("Value of x: %d",x);
with only x changing, the message must be static
(only displaying once and x changing)
x++;
}
Makes sense ?
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
you mean, all the text remains on the same line ?
use the escapment character '\b' to remove the last character (and then to overwrite it)
|
|
|
|
|
Thanx toxcct never heard of the escapment character '\b' before. But now I do ..
Thanx again.
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Programm3r wrote: ...never heard of the escapment character '\b' before.
Probably because it's called a backspace.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
LMAO ...
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Programm3r wrote: use printf and you want to display a message with a counter
I guess you want to do something like this:
<br />
int i, j, charCount;<br />
<br />
for(int i=0; i<100; ++i)<br />
{<br />
charCount = printf("Progress: %d %%...", i);<br />
<br />
for(j=0; j<charCount; ++j)<br />
printf("\b");<br />
<br />
for(j=0; j<charCount; ++j)<br />
printf(" ");<br />
<br />
for(j=0; j<charCount; ++j)<br />
printf("\b");<br />
<br />
}<br />
Programm3r wrote: The same question for achiving this in a messagebox.
You will have to create your own Dialog box for that. The common MessageBox wont do.
"Do first things first, and second things not at all."
— Peter Drucker.
|
|
|
|
|
YES, thanx alot ... exactly what I wanted ...
int i, j, charCount;
for(int i=0; i<100; ++i)
{
charCount = printf("Progress: %d %%...", i);
for(j=0; j<charCount; ++j)
printf("\b");
}
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Programm3r wrote: Lets say you use printf and you want to display a message with a counter, but the message must not repeat itself but the counter must. The same question for achiving this in a messagebox.
Na.. you can't do that! unless you implement your own MessageBox, which support Formatted Output!
|
|
|
|
|
Thanx for the input ThatsAlok and reply ..
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Programm3r wrote: The same question for achiving this in a messagebox.
To add to previous replies, you need customized message box for that.
Have a look at this article by Michael P. Mehl [^].
He has explained similar thing.
|
|
|
|
|
Thanx for the reply and help prasad
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Programm3r wrote: Lets say you use printf and you want to display a message with a counter, but the message must not repeat itself but the counter must.
Why don't you write a dedicated message box function that does this...
For eg:
void __cdecl ShowMsg( LPCTSTR lpctszTitle_i, const DWORD dwIconType_i, LPCTSTR lpctszMessage_i, ... )
{
va_list vaArgList;
va_start( vaArgList, lpctszMessage_i );
CString csMsg;
csMsg.FormatV( lpctszMessage_i, vaArgList );
MessageBox( AfxGetMainWnd()->GetSafeHwnd(),
csMsg,
lpctszTitle_i,
dwIconType_i );
va_end( vaArgList );
}
And call this function like wise
ShowMsg( _T( "Title" ),
MB_OK|MB_ICONINFORMATION,
_T( "My name is %s, my age is %d" ),
_T( "Nibu babu thomas" ), 27 ); You can customize this function for your need.
|
|
|
|
|
Hi Nibu babu thomas,
Thanx for the reply and the code snippet, I'll see what I can do ..
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
i have to insert a string between "init" and "start" in a file. how to write this. is there any function to write in the middle of the file
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
1) do you know the exact structure of the file content ? is it text or binary ? how are shaped the internal elements ?
2) what have you already tried ?
3) what's the problem with the previous answers[^] you got ?
couldn't you just follow the same thread ?
|
|
|
|
|
No, this is not possible directlt. You will need to read your file in memory (for example in a string) and insert the data there. Then you will need to write everything to the file again.
|
|
|
|
|
i want to know about the tcp flow in network simulator so that i could make changes in desired place.
One more thing after change in code of network simulator each time we have to configure it then install it or there's some other way out.
please reply me soon...
Please reply me soon.......n u can ask me any questions in c/c++/.net
|
|
|
|
|
chandni chi wrote:
Please reply me soon.......n u
i can't understand your requirement.. could you tell us that in bulleted point.. that may be much easier
"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
|
|
|
|