Band Object Implementation Sample

Hello,
well, Let me start saying that I know nothing about MSVC++.

What I want to do is just compile a pretty cool sample that is it this URL:
http://msdn.microsoft.com/isapi/msdnlib.idc?theURL=/library/psdk/shellcc/shell/samples/bands/bandobjs_cpp.htm

All files are there, what I have to do know...
I tried to create a new project and place all files there but I received an error message:
"Compiling...
StdAfx.cpp
Compiling...
explorer.cpp
clsFact.cpp
c:\c++\hello\clsfact.cpp(196) : fatal error C1010: unexpected end of file while looking for precompiled header directive
CommBand.cpp
c:\c++\hello\commband.cpp(696) : fatal error C1010: unexpected end of file while looking for precompiled header directive
deskband.cpp
c:\c++\hello\deskband.cpp(826) : fatal error C1010: unexpected end of file while looking for precompiled header directive
explrBar.cpp
c:\c++\hello\explrbar.cpp(695) : fatal error C1010: unexpected end of file while looking for precompiled header directive
bandObjs.cpp
c:\c++\hello\bandobjs.cpp(292) : fatal error C1010: unexpected end of file while looking for precompiled header directive
Generating Code...
Error executing cl.exe.

explorer.dll - 5 error(s), 0 warning(s)
"

Can somebody help?

thanks
dorockAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jkrCommented:
Simply add a

#include <stdafx.h>

at the beginning of every file mentioned above, and it should work.

Feel free to ask if you encounter problems!
0
jkrCommented:
To elaborate: VC++ builds so called 'precompiled header files', in which it stores (as the name implys) information about header files invoked in your project in order to speed up the build process. This is done through one specific header (namely 'stdafx.h') - if it is missing in your .cpp file, VC++ is insulted ;-)
0
dorockAuthor Commented:
It is much better now...
but I still have 3 errors...
he it is:

Deleting intermediate files and output files for project 'explorer - Win32 Debug'.
--------------------Configuration: explorer - Win32 Debug--------------------
Compiling...
StdAfx.cpp
Compiling...
explorer.cpp
clsFact.cpp
c:\c++\hello\commband.h(34) : error C2018: unknown character '0x60'
CommBand.cpp
c:\c++\hello\commband.h(34) : error C2018: unknown character '0x60'
deskband.cpp
explrBar.cpp
bandObjs.cpp
c:\c++\hello\commband.h(34) : error C2018: unknown character '0x60'
Generating Code...
Error executing cl.exe.

explorer.dll - 3 error(s), 0 warning(s)

"

unknown character '0x60' ,, what the heck is that? :)



thanks!!

0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

dorockAuthor Commented:
Ok it was my fault...

now I have it...

"

--------------------Configuration: explorer - Win32 Debug--------------------
Compiling...
CommBand.cpp
Linking...
bandObjs.obj : error LNK2005: _DllMain@12 already defined in explorer.obj
Debug/explorer.dll : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.

explorer.dll - 2 error(s), 0 warning(s)

"

0
jkrCommented:
Fine!

Why did you reject my answer? It obviously solved the question you asked ...

I assume you copied the code from the web page and pasted it into the editor - this sometimes leaves characters that aren't recognized by the compiler...
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dorockAuthor Commented:
There you go, sorry, It was my fault, but I still have errors,

Deleting intermediate files and output files for project 'explorer - Win32 Debug'.
--------------------Configuration: explorer - Win32 Debug--------------------
Compiling...
StdAfx.cpp
Compiling...
explorer.cpp
clsFact.cpp
CommBand.cpp
deskband.cpp
explrBar.cpp
bandObjs.cpp
Generating Code...
Linking...
bandObjs.obj : error LNK2005: _DllMain@12 already defined in explorer.obj
Debug/explorer.dll : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.

explorer.dll - 2 error(s), 0 warning(s)



The name of the dll should be "bandObjs.dll", but I changed to explorer.dll, Could it be the problem??

thanks
0
jkrCommented:
Hmm, did you set up a new project for this task? If not, make sure to either do so or remove the 'explorer.cpp' file from your project...
0
dorockAuthor Commented:
He jkr, can you help me?

I have all files, *.cpp and *.h and I have MSC++ 6.0

I am create a new project, click in Project tab, my project name will be bandObj, location = "c:\c++\bandObjPR

In the wizard I choose "A simple DLL project" then I click finish and after OK button ...

Now I have to add my files, right?
SO I click Project/Add to Project/Files
and add all files that I have...

Now I click in build/build bandObj.dll

and I got that message:
"--------------------Configuration: bandObj - Win32 Debug--------------------
Compiling...
StdAfx.cpp
Compiling...
bandObj.cpp
clsFact.cpp
CommBand.cpp
deskband.cpp
explrBar.cpp
bandObjs.cpp
Generating Code...
Linking...
bandObjs.obj : error LNK2005: _DllMain@12 already defined in bandObj.obj
Debug/bandObj.dll : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.

bandObj.dll - 2 error(s), 0 warning(s)
"

What am I doing wrong?


0
dorockAuthor Commented:
Ok I found the error...
thanks!!!

0
dorockAuthor Commented:
Hey, did you ever try to create a new explorer bar, like search bar, in IE5?
it's pretty cool!!
0
jkrCommented:
Sorry for the delay, have been 'offline' for a moment ;-)

No, I haven't ... but perhaps I'll give it a try when my time allows it :-(
0
dorockAuthor Commented:
I have to learn alot of c++ to do it...
:(
Should have a way to do it using VB :)

have a good night..

see ya
0
dorockAuthor Commented:
I had a problem when I compiled it and tryed to register the component I received that error
"bandobj.dll was loaded, but the DllRegisterServer entry point was not found.
DllRegisterServer may not be exported, or a corrupt version of bandobj.dll may be in memory. Consider using PView to detect and remove it"

Do you know how to solve it?

thanks...

0
jkrCommented:
Hmm, I assume you didn't use a .def file...

It has to be something like

;mydll.def : Declares the module parameters for the DLL.

LIBRARY      MYDLL
DESCRIPTION  'blah'

EXPORTS
    DllCanUnloadNow             @2 PRIVATE          ;DLL unloading
    DllGetClassObject           @3 PRIVATE          ;Component object model
    DllRegisterServer           @4 PRIVATE          ;Component object model
    DllUnregisterServer         @5 PRIVATE          ;Component object model

Just adding it to your project should be sufficiant...
0
dorockAuthor Commented:
YESSSSSSSSS!!!
It worked!!!

thanks alot man!!!

I just needed to took of the last line
"LIBRARY      bandObj.dll
DESCRIPTION  'blah'

EXPORTS
    DllCanUnloadNow             @2 PRIVATE          ;DLL unloading
    DllGetClassObject           @3 PRIVATE          ;Component object model
    DllRegisterServer           @4 PRIVATE          ;Component object model
   "

thank you!!!


have a good day!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.