|
Mr I DONT NO wrote:
THANK YOU ALL IN ADVANCE !!!!!!!!! HAPPY PROGRAMMING
YOU COULD WRITE IT AS A SERVICE
Oops. Dunno how that happened. I turned the caps lock on and all the letters went big
Nish
Make MSDN universal, FREE!
|
|
|
|
|
Nish [BusterBoy] wrote:
Dunno how that happened
And you think I'll believe you?
Philip Patrick
Web-site: www.saintopatrick.com
"Two beer or not two beer?" Shakesbeer
Need Web-based database administrator? You already have it!
|
|
|
|
|
You can also put a registry entry under Run, I always forget where that is, I search for RunOnce and it's just above.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
Christian Graus wrote:
You can also put a registry entry under Run, I always forget where that is, I search for RunOnce and it's just above.
It's in two places:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
and
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run
with the obvious difference between the two.
Sometimes i only remember, The days when i was young Nowadays no one remembers when they were young and stupid... ADEMA, The Way You Like It
|
|
|
|
|
I just add an internet explorer object to the project, add a test method and propertie, and compile. When I open the html test file, close it, and try to recompile the source, this menssage apper:
Compiling...
TesteCtl.cpp
Linking...
LINK : LNK6004: Debug/Teste.dll not found or not built by the last incremental link; performing full link
LINK : fatal error LNK1104: cannot open file "Debug/Teste.dll"
Error executing link.exe.
Teste.dll - 1 error(s), 0 warning(s)
And, when I can't delete the file from windows explorer.
Any one know how to solve this?
Thanks
|
|
|
|
|
Reboot the machine, delete Debug/teste.dll (hopefully you'll be able now) and perform a "Build all". Good luck!
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Your app is not releasing the dll when it is finished.
Check this out in MSDN
BOOL FreeLibrary(
HMODULE hModule // handle to DLL module
);
|
|
|
|
|
Your shell is set to run all Explorer/IE windows in the same process, so after the IE windows closes, the process is still running and the DLL is still in use. You need to change that setting so each window is a separate process. Check out my shell extension article part 1 in the shell section where I describe what to do.
BTW in the meantime, you can open a DOS box, CD to the dir and rename the DLL to some other name. Then you'll be able to rebuild it.
--Mike--
"Jobs that don't allow you to visit the Lounge 25 times a day at the minimum are not worth having anyway."
-- Nish, 3/28/2002
My really out-of-date homepage
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan and Jamie Salé.
|
|
|
|
|
I've been looking into how to handle updates to my files that may happen in the future.. i see that if i use:
IMPLEMENT_SERIAL(CMyObject, CObject, VERSIONABLE_SCHEMA|1)
then i can do an if statement based on ar.GetObjectSchema() when i do my loading.. which looks like is just what i need.. my own serializable class i have written (based off CObject) has this 'IMPLEMENT_SERIAL' command in it, however my built in Document class does not have this command anywhere..
how do i set the version of the document if there is no 'IMPLEMENT_SERIAL' command? I have all the serialization done, and it has been working fine, but I don't know if it is safe for me to put the IMPLEMENT_SERIAL command in there, or if this is somehow derived from CDocument?
thanks in advance!
-dz
|
|
|
|
|
Any advice? i could write my own serializable object, but im using the document with the views i have.. if i call the ar.GetObjectSchema() from the serialize function of the CDocument i always get '-1', which means its an unknown version, any help, plz?
-dz
|
|
|
|
|
See this article.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
dazinth,
I just had a similar problem. When you use CArray<cmyobj, cmyobj&=""> then you need to override SerializeElements (see MSDN). My solution was to store and load the version right before the elements were serialized and then set the object schema member variable as each element was serialized. Hope this helps.
Ted
//////////////////////////////////////////////////////////////////////
// Serialize the FEVface
// necessary because CArray does not provide this function itself
//////////////////////////////////////////////////////////////////////
template <> void AFXAPI SerializeElements <cmyobj> ( CArchive& ar, CMYobj* pNew, int nCount )
{
UINT version;
if (ar.IsLoading() == TRUE) {
ar >> version;
}
else {
ar << CONST_CURVERSION;
}
for ( int i = 0; i < nCount; i++, pNew++ ) {
ar.m_nObjectSchema = version;
pNew->Serialize( ar );
}
}
|
|
|
|
|
Change the Serialize function in your data class as follows
void CMyData::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
ar.WriteClass(RUNTIME_CLASS (CMyData));
ar << m_szName;
ar << m_szAddress;
}
else
{
try
{
ar.ReadClass(RUNTIME_CLASS (CMyData));
}
catch(CArchiveException *e)
{
AfxMessageBox("invalid file");
e->Delete();
return;
}
ar >> m_szName;
ar >> m_szAddress;
}
}
This will save the schema number properly.
|
|
|
|
|
Are there any office XP menu classes that actually do everything? so far i havent seen any that do the shadow behind the menus. This is what impresses me more than the blue toolbar etc...
I'm not late, I'm just not as early as I could have been.
MSN Messenger address: jonathann4@hotmail.com feel free to chat!
|
|
|
|
|
For the ahadows check this http://www.codeproject.com/menu/shadowmenu.asp, tha flat look, well i'm working on that, but is really hard for me
|
|
|
|
|
Some hints
- See the Fakemenu sample in an older PSDK dsitribution (emulates a menu, capturing mouse)
- In WTL, see http://viksoe.dk, for a flat (no shadows, but flat ) sample.
- Generic
Set a Hook, once again, the WTL files show you how to set the hook and the magic number to detect the menu window (somewhere in CCommandBarCtrlImpl<t,...> , don't remember where)
Regards,
R.
|
|
|
|
|
I am using the following lines in function InitInstance() to associate file types to my application in a MDI architecture:
//Associate the file types
EnableShellOpen();
RegisterShellFileTypes(true);
The procedure is standard MFC and documented in many places.
When I double click my files with extension .spt the application is starting, but I am also getting the following system error message:
Cannot find the file "D:\VC++\MyApp\test1.spt" (or one of its components). Make sure the path and filename are correct and that all required libraries are available.
This message is wrong because the path and filename are correct. Could somebody explain what is happening?
|
|
|
|
|
I've had the same problem in the past when registering the same extension from different programs (or the same prorgam at different locations). Try looking for the occurrences of .spt and related identifiers (Spt.Document , stuff like that) in the registry and deleting them.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I know it has been a while, but did you ever find out what the problem was? I am having the same problem.
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
I'm using the following command in my program to close the CD Tray.
::mciSendString("set CDAudio door closed", NULL, 0, NULL)
But the problem is, after closing the CD tray the program is waiting for the CD to be read by windows (i.e. open a autorun file etc.). During this time the program appears to be hung. I was using the same API call in my VB version of the program. It did not have this problem. The app should only wait like this if I had used "notif" or "wait" parameters, right?
What am I missing here?
|
|
|
|
|
What is the reason to have most of ATL source code in .h files? Is there any disadvantage to having template functions in .cpp files? Can anyone point me to good articles on this topic?
|
|
|
|
|
Satheesh wrote:
What is the reason to have most of ATL source code in .h files?
IIRC, this is just so that the functions will be automatically inlined (where possible, of course).
Peace!
-=- James.
|
|
|
|
|
You can't have template functions in CPP.
Now the standard does have the 'extern' keyword to provide the ability to place template functions in CPP files, however, nobody supports this element of the standard.
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?
|
|
|
|
|
Tim Smith wrote:
You can't have template functions in CPP.
Meaning "Templated Functions"? So I cannot declare them in a CPP file, or I cannot specialize the template in a CPP file? I am asking because I am under the impression that specializing an STL template (like std::vector) creates templated functions (like vector::push_back), and while I do not do it personally (I use typedefs in .H files), I have seen code that specializes templates in CPP files like this:
<br />
std::vector< DWORD > vecDWORDs;<br />
<br />
vecDWords.push_back( 0xFF );<br />
vecDWORDs.push_back( 0xFFFFFFFF );<br />
Or am I misunderstanding you (or templates, for that matter)?
Peace!
-=- James.
|
|
|
|
|
Ok, let me clarify. What you can't do is define a template in an H file, then implement the methods of that template in a CPP file and THEN try to use those routines in another CPP file.
So, you can define templates in a CPP file just fine. But the methods can not be used in a second CPP file. That is why template methods are commonly found in the H file as inline methods.
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?
|
|
|
|