|
void MyThreadFuction (void* Download)
{
CDownload* NewDownload = (CDownload*)Download;
char *HostName = new char[wcslen(NewDownload->HostName)+1];
}
|
|
|
|
|
Thank You for your patience.
Actually I had done that same workaround fix, but since of my inexperience I thought I was doing it wrong.
As it appears I found another reason causing the disruption which has caused all this fuss.
Since I'm using long long, doing a percentage calculation. However because of 0 being part of my calculation. It crashes! Bringing up lldiv.asm to Line 121 due to the 0 value. Anyway I will try understand went wrong later. Thanks again for your help Nameless MVP!
|
|
|
|
|
I briefly talk about this here.
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
I remember reading that - a great piece of code (not that you need me to tell you)
I'm sure someone was asking about printer notifications recently here on CP as well, so your article was timely.
'g'
|
|
|
|
|
<pre>_beginthread(MyThreadFunction, 0, NULL);
Tried to pass a value like in regular C++ functions.
_beginthread(MyThreadFunction(MyData), 0, NULL);</pre>
look at how you call _beginthread and combine what the other people have already posted. You have the idea, but just look at how _beginthread is defined.
~ELChupathingy
|
|
|
|
|
Here's a nice writeup[^] on the subject. He emphasises on MFC, but the idea is the same.
A book on threading would be of immense help to you.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
So in a normal C++ environment you can use fstream!
CFile in MFC applications, does anyone know of other file writing functions that don't involve MFC.
While also restricting output with number of bytes to write?
|
|
|
|
|
Fareed Rizkalla wrote: does anyone know of other file writing functions that don't involve MFC.
How about WriteFile() and fprintf() ?
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
You could start here[^] and work your way up. The basic IO functions require you to do all the work, in terms of formatting your data.
It's time for a new signature.
|
|
|
|
|
I have a lot of legacy code using fprintf(stderr, .....); I also have monitoring pane which is a CEdit control. How can I redirect stderr to output into the CEdit control?
I have a look around but most of the answers involve the creation of a new process. Is any simpler way of doing it? Effectively what I 'd like to do is something like
start redirection of stderr to myEditControl;
fprintf(stder, ....);
finish redirection of stderr
Thanks
|
|
|
|
|
It's not a trivial task. See here and here.
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Thanks, I have already looked at it but they involve a CreateProcess call. Which means an extra process. This is what I want to avoid actually.
|
|
|
|
|
Have anybody compile PDFlib Lite 7.0 to get pdflib.lib file ? PDFlib offer a lite version of their library , 7.0.4 , but must compile to obtain a valid library ... I don't know how ! Can anybody help me ? Source code is here , only must download , compile to get pdflib.lib file ... My error is :
LINK : fatal error LNK1181: cannot open input file "pdflib.lib" , or really this I want to get it !
|
|
|
|
|
Looks like you are trying to include a library file that does not exist. Have you successfully compiled all the source files?
It's time for a new signature.
|
|
|
|
|
I downloaded and extracted all the source.
I opened the PDFlib.dsw and had VS2005 convert all projects. (The ZIP is for VS6 and I'm using VS2005)
I rebuilt the DEBUG PDFlib project only and it successfully produced the PDFLib.lib file.
When compiling however it will generate a lot of warnings about unsafe functions.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
|
|
|
|
|
Seems I make it , after yours model , I get an pdflib.lib file ... now I try to use in an test project ... thank you all !
|
|
|
|
|
Finally , I generate a blank pdf page with pdflib 7.0.4 ...
|
|
|
|
|
Congratulations. Good effort.
Just remember that the light at the end of the tunnel might be an oncoming train.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
|
|
|
|
|
hi
string Str;
Asc(Mid(Str, i, 1)) in vb and i want in vc++
Chr$(Str(i)) in vb and i want in vc++
i donot vb...please help any one
|
|
|
|
|
Member 3653751 wrote: i donot vb...please help any one
There is the documentation, by the way.
Member 3653751 wrote: Asc(Mid(Str, i, 1))
The ASCII value of a the ith character of the string.
(in C++ is the character value itself, if you have a char array).
Member 3653751 wrote: Chr$(Str(i)) in vb and i want in vc++
You dont't need it in C++ (neither in VB , AFAIK).
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]
|
|
|
|
|
native C++:
static_cast<int>(Str[i - 1]);
static_cast<wchar_t>(Str[i]);
C++/CLI:
Convert::ToInt32(Str[i - 1]);
safe_cast<Char>(Str[i]);
David Anton
Convert between VB, C#, C++, & Java
www.tangiblesoftwaresolutions.com
|
|
|
|
|
In my previous post I realized I pretty messed up my project with unneeded templates.
I thought "what about creating a structure or class with a pointer to another structure and putting that pointer just when needed?"
So here's the question: I dislike personally the idea of a pointer pointing to optional data, is there any better solution to store data which always has a common header but then may vary?
---
|
|
|
|
|
create a class to store the 'common header'. then, use that as a base class and derive objects from it to store the 'optional' data.
?
|
|
|
|
|
I don't really know about your requirements, but a union may possibly be an option.
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]
|
|
|
|
|
? :
class A
{
...
};
class B
{
A* m_pA;
public:
B(A* pA = NULL) { m_pA = pA; };
};
int main()
{
A a;
B b1;
B b2(&a);
...
return 0;
}
virtual void BeHappy() = 0;
|
|
|
|