|
From a command-prompt:
source.exe | filter.exe | sink.exe
No need to worry about creating your own pies, buffers, preocesses or any of that stuff.
|
|
|
|
|
There is an article on CP by Joseph Newcomer on this subject. It helped me on one of my projects.
Ted
|
|
|
|
|
Hello
I would like to write a C function that find the first prime number above a given number (the number is a parameter of the function). The function I have written so far is not very fast and I would like any help you can offer me.
Thank you very much.
|
|
|
|
|
Let's make a deal... stop with the anon posting and you'll get one. IMHO, people that have to secretly ask for help are the ones that'll steal it and gank the credit.
Jeremy L. Falcon
"The One Who Said, 'The One Who Said...'"
<nobr>
Homepage : Sonork = 100.16311 01000010011011110110001000100000011101110110000101110011 00100000011010000110010101110010011001010010111000000000
|
|
|
|
|
If you can live with a C++ implementation, you could have a look at a snipped from SourceForge.
Note that this implementation only works with relatively small numbers, up to 2^32-1 (I believe). If you want larger integers you should probably have a look at something like the GNU MP library or NTL (linked from the GMP homepage).
|
|
|
|
|
Aw man, ya ruined it for me. I was having fun.
Jeremy L. Falcon
"The One Who Said, 'The One Who Said...'"
<nobr>
Homepage : Sonork = 100.16311 01000010011011110110001000100000011101110110000101110011 00100000011010000110010101110010011001010010111000000000
|
|
|
|
|
Oh, what a complete bastard I am, helping AC's like that. Shame on me!
|
|
|
|
|
There, I went and voted a 5/5 for your article (pretty cool). I hope you learned your lesson!
Jeremy L. Falcon
"The One Who Said, 'The One Who Said...'"
<nobr>
Homepage : Sonork = 100.16311 01000010011011110110001000100000011101110110000101110011 00100000011010000110010101110010011001010010111000000000
|
|
|
|
|
I hope you learned your lesson!
I sure did. That's what one gets for trying to be helpful even to AC's, someone goes and vote 5/5 for an article you wrote!
Seriously, I do hope the article got that vote for its contents (and that it was of use).
.sig? My name is displyed at the top of my post
|
|
|
|
|
Having created a custom browser in my application usign the Webbrowser control, is it possible to have separate security settings than those defined on the machine for Internet Explorer?
My application will be used for exchanging information in an HTML format and to avoid any problems I'd like to disable scripts and ActiveX objects, etc. in the app's browser to prevent the spread of viruses via the software.
Is it up to the user to set their security settings for IE and me warn them, or can I turn nasties off in my app without affecting IE?
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|
|
I need to persist an STL collection to disk. Has anybody done something like this?
|
|
|
|
|
Assumming the elements of your container can be written to an ostream with operator << , then the following one-line routine makes the trick:
std::copy(c.begin(),c.end(),std::ostream_iterator<T>(ofs,"\n")); where c is your container, T is the type of the elements of the container and ostr is an ofstream where you do the writing to.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Does anyone know where I could find a good VC++ MFC Example Dialog application that uses pipes?
Thanks
|
|
|
|
|
What kind of pipe? Crack pipe? Weed pipe? Pls give more details.
In the meantime, check out MSDN...
mk:@MSITStore:C:\Program%20Files\Microsoft%20Visual%20Studio\MSDN\2001JAN\1033\ipc.chm::/hh/winbase/pipes_2vqr.htm
Jeremy L. Falcon
"The One Who Said, 'The One Who Said...'"
<nobr>
Homepage : Sonork = 100.16311 01000010011011110110001000100000011101110110000101110011 00100000011010000110010101110010011001010010111000000000
|
|
|
|
|
In order to use an excel automation, i need the excel9.cpp and excel9.h.
How can i obtain them.
Thanks.
Aziz Rajim.
|
|
|
|
|
See "HOWTO: Automate Excel and Then Know the User Closed It (Q192348)" on MSDN.
|
|
|
|
|
Thanks, Thanks, Thanks, Thanks, Thanks, Thanks, ... David.
I'm so happy!
Aziz Rajim
Aziz Rajim
|
|
|
|
|
Ok I am confused:
I would like to implement putref_Item property
to be accessed from vbscript/Jscript
putref_Item(BSTR name, VARIANT newVal)
{
...
//set to IDispatch
CComVariant vtOld = map.Lookup(name);
map.Set(name, newVal);
}
VBScript
Dim z
z = Server.CreateObject( Dummy.Object)
Set X("db") = z
Set X("db") = Nothing
........................................................
How does reference counting suppose to works?
Should I call vtOld->Release() vtNew->AddRef()
Should I call addRef on propGet ???
Thanks
|
|
|
|
|
Nevermind
use smart ComPtrs and don't worry about these things
|
|
|
|
|
I'm using MS Soap Toolkit 2 and VC 6.0. What I need to do is to retrieve in a buffer the Soap message generated by a SoapSerializer. I read on MSDN that a serializer could be initialized with any object that has an IStream interface. I tried something like
ISoapSerializerPtr pISerializer;
IStreamPtr pIStream;
char buf[1024];
ULONG nToRead=1024, nRead;
pISerializer.CreateInstance(__uuidof(SoapSerializer));
CreateStreamOnHGlobal((HGLOBAL)0, TRUE, &pIStream);
pISerializer->Init(_variant_t(pIStream));
pISerializer->startEnvelope("","","");
//.........
pISerializer->endEnvelope;
pIStream->Read(buf, nToRead, &nRead);
...without succeding.
Any suggestion?
Thanks in advance.
--
Gian Luca
|
|
|
|
|
If you are using Win32 only and no MFC at all and you have a DialogProc and you would like to add a text control to the dialog box during the run time and not through resource editor, how would you do it?
I tried using CreateWindow and passing the dialog handle as the parent, but I don't see anything created on my dialog eventhough a handle is definitely returned by the CreateWindow command. Do I have to do anything else to make it show up on my dialog?
thanks
|
|
|
|
|
It is usually one of two things.
1. You don't have WS_VISIBLE as one of the window styles.
2. You rect coords are wrong. The coordinates need to be relative to the dialogs client origin. This just means that if you want to have the control at 10,10 in the dialog, you just have to specify 10,10.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
I have global variables
float xtrans, ytrans; defined in my file TestGLView.cpp
and I have this function for handling keyboard events in my file ChildFrm.cpp
void CChildFrame::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
// TODO: Add your message handler code here and/or call default
CMDIChildWnd::OnKeyDown(nChar, nRepCnt, nFlags);
char keypressed = char(nChar);
if(keypressed == 'I')
ytrans += 0.2;
if(keypressed == 'K')
ytrans -= 0.2;
}
this function uses the global variables from TestGLView.cpp
so I need to #include "TestGLView.cpp" in the file ChildFrm.cpp
but when I do that, I get this error:
C:\WINDOWS\Desktop\QE2 heart program\ChildFrm.cpp(14) : error C2370: 'THIS_FILE' : redefinition; different storage class
c:\windows\desktop\qe2 heart program\testglview.cpp(22) : see declaration of 'THIS_FILE'
so I comment out this line from ChildFrm.cpp since its present at the top of both files:
static char THIS_FILE[] = __FILE__;
but then I get tons of other errors, here are some:
TestGLView.obj : error LNK2005: "public: static class CObject * __stdcall CTestGLView::CreateObject(void)" (?CreateObject@CTestGLView@@SGPAVCObject@@XZ) already defined in ChildFrm.obj
TestGLView.obj : error LNK2005: "protected: static struct CRuntimeClass * __stdcall CTestGLView::_GetBaseClass(void)" (?_GetBaseClass@CTestGLView@@KGPAUCRuntimeClass@@XZ) already defined in ChildFrm.obj
TestGLView.obj : error LNK2005: "public: virtual struct CRuntimeClass * __thiscall CTestGLView::GetRuntimeClass(void)const " (?GetRuntimeClass@CTestGLView@@UBEPAUCRuntimeClass@@XZ) already defined in ChildFrm.obj
So how can I alter the global variables from another file without having to deal with all this? There must be an easier way???
|
|
|
|
|
This is what the 'extern' keyword is used for. In your ChildFrm.cpp file, JUST use the following (no need for #include "TestGLView.cpp"):
extern float xtrans, ytrans;
Cheers,
Free
|
|
|
|
|
Instead of including TestGLView.cpp , add
extern float xtrans, ytrans; to ChildFrm.cpp , so the compiler knows, that they're implemented in another file of this project.
Regards
Thomas
Finally with Sonork id: 100.10453 Thömmi
Disclaimer: Because of heavy processing requirements, we are currently using some of your unused brain capacity for backup processing. Please ignore any hallucinations, voices or unusual dreams you may experience. Please avoid concentration-intensive tasks until further notice. Thank you.
|
|
|
|