|
Erik wrote: I have tried this, but it doesn't work right.
You have tried what ? Starting a new thread and spawning your processes from within that thread ? It seems not really what you did. If you do that in a separate thread, you don't have to worry about pumping the message queue or repainting or window.
|
|
|
|
|
Hello,
I am facing a strange problem in my c Windows application sigle-threaded, using VS2008 compiler.
errno is used after system calls to identfiy if any error occured. I have placed checks in my code at various places to know if any exception has occured during a flow.
In one of the function, At the beginning of a code block I check for errno occured in previous code block, if errno is zero, the normal flow continues. If errno is non-zero, nothing is done and the function returns with errno.
Now, i found out a strange issue, errno that is initialized to 0 at the start of the function, changes its value to 9 after doing a sprintf call. sprintf call is successfull though. Another strange thing about it is that this happens only when the exe is run as service on Windows Vista. If the same exe is run from Visual Studio debugger, this behavior doesn't happen when exe runs from VS directly in either release or debug mode.
I can not comprehend the behavior, any help will be appreciated.
Thanks.
Gajendra
Gajendra
|
|
|
|
|
No answers at all....Surprising.
Gajendra
|
|
|
|
|
Ok..so nobody knows it....
Gajendra
|
|
|
|
|
Hello,
I am using Vistual Studio 2005, and want to implement a CAnimateCtrl to my dialog-based application. However, I cannot figure out how I can insert a small AVI file as a resource to my project, everything I tried so far fails. What is the right way to add an AVI resource?
|
|
|
|
|
|
It can use overload to solution this but i want to know can there any
other ways
to resolve this Question because we can assump there have 100 type ,then
we must to code 100 same functions(when you use overloading)
like this
int SetOption(int a)<br />
{<br />
return a+1;<br />
}<br />
<br />
double SetOption(double a)<br />
{<br />
return a+0.1;<br />
}<br />
<br />
float SetOption(float a)<br />
{<br />
return a+5;<br />
}<br />
thank you everybody
|
|
|
|
|
Hello jeansea,
The answer is templates.
template <typename t="">
T GetValueToIncriment( T Type )
{
if( typeid( Type ) == typeid( int ))
{
return T( 1 );
}
else if( typeid( Type ) == typeid( double ))
{
return T( 0.1 );
}
else if( typeid( Type ) == typeid( float ))
{
return T( 5.0 );
}
return 0;
}
template <typename t="">
T SetOption(T a)
{
return a + GetValueToIncriment( a );
}</typename></typename>
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
i means if the funtion solution are complete different not
have little same
you ways are not useful
Is if not have the Format like " return a + GetValueToIncriment( a );"
have any way to solve it?
|
|
|
|
|
jeansea wrote: i means if the funtion solution are complete different not
You mean function body? If function body is different, there is no way other than overloading.
jeansea wrote: have little same
you ways are not useful
Really Sorry. May be due to the fact that you're question was not descriptive enough.
jeansea wrote:
Is if not have the Format like " return a + GetValueToIncriment( a );"
have any way to solve it? Laugh
Nothing else, as per my knowledge.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Sorry
My English is Poor
I Mean When Caller Type Change the Function Body will Be change also
i just want to know have any best way to solve this situation but
overloading
<br />
#include<iostream><br />
#include<vector><br />
<br />
using namespace std;<br />
<br />
int m_nType = 0x00000000;<br />
<br />
vector<string> m_vVoidName;<br />
<br />
bool VoidRedRole = false;<br />
<br />
<br />
void SetOption(int Type)<br />
{<br />
m_nType|=Type;<br />
}<br />
<br />
void SetOption(string VoidName)<br />
{<br />
m_vVoidName.push_back(VoidName);<br />
}<br />
<br />
void SetOption(bool ToVoid)<br />
{<br />
VoidRedRole = ToVoid;<br />
}<br />
you see it ,the Funtion Body isn't same ,i use overloading to solve
any other ways?
hope this description could help you
thank you all the same;P
|
|
|
|
|
jeansea wrote: I Mean When Caller Type Change the Function Body will Be change also
In that case you need a function body for every different type - there ain't no shortcuts when that's the case...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi,
I'm trying to compile CppUnit 1.12.1 on Windows XP. I have VS 2005 (V> 8.0).
I'm getting the following error: (Only one error)
error PRJ0019: A tool returned an error code from "Updating c:\Documents and Settings\sreedevi\My Documents\cppunit-1.12.1\lib\cppunitd_dll.dll" TestPlugInRunner
In the Debug htm file, it says :
Updating c:\Documents and Settings\sreedevi\My Documents\cppunit-1.12.1\lib\cppunitd_dll.dll
The system cannot find the file specified.
Project : error PRJ0019: A tool returned an error code from "Updating c:\Documents and Settings\sreedevi\My Documents\cppunit-1.12.1\lib\cppunitd_dll.dll"
I excluded the VC6 plugins, commented out the code, and solved the other
errors by including the correct version numbers in the libid import statements.
Any idea how I can solve this? Please help, I've been at it for a whole day now.
Thanks,
Sreedevi Jagannath.
|
|
|
|
|
Hello Sreedevi,
The same problem happened to me. Hopefully you have found the solution
by now as it is August, but in case you have not, be sure that your post build activities
(moving a file from the target path to the /lib path) do not have any spaces in the
path.
|
|
|
|
|
Hi,
I have created one dialog in my MFC application.I have added vertical scroll bar to my dialog.I am displaying Images on dialog.Client area of dialog should scroll when I scroll Scroll bar.I am using Visual Studio 2005.
I have added following line to OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) function.
ScrollWindow(0,-CurPos,CRect(0,0,1100,1100));
I am displaying 8 small Images as two rows on my dialog.After one scroll
Window is moving but window is showing some unwanted lines(Actually I am not printing any Images after 8 Images) .Can anyone help me.
|
|
|
|
|
|
Hello All,
I am want to convert the length of a string to a Hexa-Decimal number as a 16 Bits. So Using the _itoa(cLengthOfString,strlen(strSource),16)
where cLengthOfString is char [5] and strSource is a char *
but when i observe the destination string is having length represented in 8-bits character, I want it in 16 bits character, for e.g., xFFFF should utilize only 2 bytes, instead of 4 bytes.
Thanks,
Neelesh K J Jain.
|
|
|
|
|
To represent a integer in the range {0,65535} as hexadecimal (ANSI ) string you need 4 characters.
The binary encoding of such a number is (of course) 16 bits (i.e. 2 bytes) wide.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Neelesh K J Jain wrote: for e.g., xFFFF should utilize only 2 bytes, instead of 4 bytes.
What? How the hell is that going to happen?
Run the following code and see if you get a clue.
char buf[5];
itoa( 0xf, buf, 16);
cout << buf << endl;
itoa( 0xff, buf, 16);
cout << buf << endl;
itoa( 0xfff, buf, 16);
cout << buf << endl;
itoa( 0xffff, buf, 16);
cout << buf << endl;
|
|
|
|
|
Hi all
A quick question,
I have built an MFC application and embedded a web browser control. How do I know the type of the webpage accessed, whether animated or html based?
Thanks
llp00na
|
|
|
|
|
llp00na wrote: I have built
"have" as in past tense?
llp00na wrote: How do I know the type of the webpage
Don't you think that might have been something to study before developing the application?
You could parse the HTML to find any information you require. Also there are HTTP headers that might contain information you require. If either of those are something you don't understand then you should consider starting to read (about them) and leave off the internet forums for a while. Both subjects are well documented and the documentation is freely available on the internet.
|
|
|
|
|
Let me try again
I know what HTML and HTTP headers are.
I am trying to detect this automatically. Let's say the user types in the URL of a website, I want the application to report back to him:
The website you entered is "Fully nnimated"
Or
The website you entered is "HTML-Based"
You got my question now???
llp00na
|
|
|
|
|
llp00na wrote: You got my question now???
Maybe. And maybe I don't care a bit about.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
What do you mean by 'animated'?
Also, pretty much all web-pages have at least an outer layer of HTML, no matter what their content.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I meant, flash-based. I.e. they heavily use flash animation for interactivity.
llp00na
|
|
|
|