|
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.
|
|
|
|
|
How do I check to see if the key being pressed is the up, down, left or right arrow key? i.e. to check if "I" is pressed, I do this:
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')
//Do stuff
}
but what do I write in the if statement to check for an arrow key?
|
|
|
|
|
You can use VK_LEFT, VK_UP, VK_RIGHT and VK_DOWN
Nish
The rumours that I am an AI bot are absolutely false. These rumours have been propogated by *them* to focus all the attention on to me, while *their* bots take over the planet. Thank y%%%% Divide by zero. Cannot proceed. Abort(y/y)?
|
|
|
|
|
You can find all of the other lookup codes in MSDN by looking up Virtual Key Codes.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
You may need to handle the arrow keys in the PreTranslateMessage function which you can override.
if (pMsg->message == WM_KEYDOWN)
{
switch (pMsg->wParam)
{
case VK_UP :
case VK_DOWN :
case ...
}
}
you should return TRUE if you dont want te message to be processed further, or pass the message through to the base class to allow it to be processed by controls as normal.
Roger Allen
Sonork 100.10016
yet to be identified being from the planet Paltinmoriumbanfrettybooter
|
|
|
|
|
Hi,
I have one project which is using DAO with an access97 database, now we want to change the database to Access 2K. But, of course, we have some problems:
steps.
Database migration to Access 2K. (No problems)
Test the Application with new database (Format not recognize), I was investigating it but I only found that my project is using DAO35 with MFC42 (version 6.0) and it seems that it needs DAO36 and MFC version >= 6.01.
I not sure, and I hope that somebody could be in the same trouble that I am now.
Thanks!!
---------------------
Pere Llibre
Software Engeneering
|
|
|
|
|
Have you installed MDAC 2.7?
Nish
The rumours that I am an AI bot are absolutely false. These rumours have been propogated by *them* to focus all the attention on to me, while *their* bots take over the planet. Thank y%%%% Divide by zero. Cannot proceed. Abort(y/y)?
|
|
|
|
|
Yes I have MDAC 2.7 installed, but nothing happens.
I have VC6 with sp5 -> mfc version 6.0 and I found that MFC load DA035 with this msvc.dll (access2k not supported), If you have mfc version >= 6.01 it will use DAO36 (access2k supported).
Do you know something about it? or anything else? Thanks for your prompt repply.
---------------------
Pere Llibre
Software Engeneering
|
|
|
|
|
Your problem is very common. Is no problem with librarys, neither MDAC, is a problem in the class of dao, this classes are usin the incorrect version.
For that you need to find, an article that wrote paul dilascia in MSJ, in the the first or second mounth of 2000 year. In that Article Paul explain the solution for your problem...
I will try to find that article.
Give me a couple of hours...
Regards
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|