|
Hi,
I am working on windows XP machine, Visual Studio 6.0(SP5),
I am trying to draw caption using the following function :
::DrawCaption(m_hWnd, *pDC,&rcCaption,DC_ACTIVE|DC_TEXT|DC_GRADIENT);
Studio reports the error that DC_GRADIENT is undeclared identifier.
If I go to the source of where this macro is declared, I see a conditional declaration that if WINVER is >= 0x500 only then this could be compiled.
If I look for the source of WINVER, it is 0x400 in some files(winRes.h and Windows.h), and 0x500 in other files(WinRef, WinUsr, WinGDI & WinDef).
Now I could not understand, that why is it defined to 0x400, on my XP machine ?? is it a issue with some Service pack ??
Could some body please throw some light on this ?
Regards,
Abhishek Narula
|
|
|
|
|
The only thing that matters is what you define for WINVER. If you assign a value of 0x500, all that's meant to work under 5.0 and higher will get compiled without errors. In the corresponding files, there're some ifdefs which introduce some identifiers if your version passes the comparison, otherwise not. The standard WINVER is 400 I think.
|
|
|
|
|
The best ist to define this value for yourself and NOT to set WINVER = 0x500 because there may arise problems if the programs isnt running under XP.
Try this @ home. (B&B)
|
|
|
|
|
i need to access zip and jar file directly by c++.
in someway, i am doing an unzip and unjar program.
in the moment, i only can do:
zip file:
read all structures with right info (OK)
problem: for code part, i don't know its format, so i can't translate it to oringinal file.
jar file:
none (only few info from google).
who knows useful links and books about their format - espacially about code part?
thx for any help.
includeh10
|
|
|
|
|
|
Have you tried ZipArchive at
http://www.artpol-software.com/
?
There's a free library there that allows you to read and write ZIP files that's very easy to use, I don't know if that's any use to you.
Cheers,
KB
|
|
|
|
|
Have a look at zziplib. If you want to, you can even replace plain fopen with zzip_fopen and read the file like it was a plan C stream.
As for jar file, it completely depends if you're talking about the .jar extension that Sun "stole", or the more widely spread and later hijacked JAR archiver (the successor to ARJ). If the former, it's nothing more than a renamed .zip-file. For the latter, check the ARJ/JAR site and see if there is a free unpack lib.
++luck;
|
|
|
|
|
hi, thx u 3!
i need to access sun's java jar file first, than more...
what does "stole" mean here? is there any special?
includeh10
|
|
|
|
|
includeh10 wrote:
what does "stole" mean here?
The JAR archiver was on the field before Java even became hype (IIRC). A jar archive therefore had a well-defined meaning: an archive created by the JAR archiver.
Then Sun came along with Java. First they used the .zip extension (as one would expect, since Java class-collection archives are just zip-files).
Later Sun decided this wasn't any good. They wanted something that differentiated a Java .zip archive from any other .zip archive. What could be more obvious than taking a zip-file and changing the extension to .jar (Java ARchive)? Well, I can come to think of a gazillion better things to do - especially since they by this move overloaded even the meaning of "jar archive". This was a Bad Thing(tm).
Nowadays "a jar archive" can be either a JAR archiver archive (with .j extension) or a collection of Java classes in a zip-file (renamed to the .jar extension), and without explicit context or qualification there is no way to know which one people are talking about (hence my previous answer to your question).
So the meaning of "stole" in this context was to display that Sun hijacked an already existing TLA used in the same field (archives and archivers).
|
|
|
|
|
Hi everybody.
I'm writing a CD PLAYER, (with my own class), using the MCI COMMANDS
with the SendString function.
Everything goes well, but I have two problems.
First: How can I detect when an AudioCD is insert?.
Right now, I have a member function in my class called IsCDInsert()
and with a WM_TIMER message in my dialog, (the method wake up every second),
I can do that, but I think that this is not the right way.
Maybe the question could it be: How can I make my cd player the default player?.
Second: I have, (for example), a slider control in my dialog, and I like to control
the CD Volume with it. How can I link that control with the sistem volume function?.
I have see the MCIWndGetVolume() function, but I dont have a MCI window, and the
function waveOutSetVolume() but I think that it's only for wave files.
Well, thank you very much.
Sorry about my english.
Demian.
|
|
|
|
|
I'm creating an OLE container doc/view (MFC), which can embed Excel workbooks within it; I have a need for the VBA in Workbook_Open() to be executed when the document is opened, but am having a spot of difficulty with that.
Sometimes the VBA is executed, sometimes it isn't - really inconsistent. Has anyone managed to successfully do this, or could you point me in the right direction for making sure that the VBA is always executed?
Dylan
|
|
|
|
|
Hello all,
I'm working with HtmlView in VC7.
I have a problem to get all URL of multiframes web page.
I would like to get the URL of the page which have the focus.
You know how to do this?
thx in advance.
|
|
|
|
|
Well, it's only a try!
Getting all URLs of your web page isn't very complicated - for every frame the function OnBeforeNavigate2 gets called, providing the URL.
But determination on gaining focus should be a more advanced task.
When your document is loaded, you can get a pointer to all frames of your window by IHtmlWindow's get_frames function. Then you should implement a connection sink and connect to all IHtmlElementEvents2. Then you could react on it's onfocus event.
Connecting to the events could be done in the following way:
void CMyClass::ConnectEvents(IHTMLElement* pElem)
{
HRESULT hr;
IConnectionPointContainer* pCPC = NULL;
IConnectionPoint* pCP = NULL;
DWORD dwCookie;
hr = pElem->QueryInterface(IID_IConnectionPointContainer, (void**)&pCPC);
if (SUCCEEDED(hr))
{
hr = pCPC->FindConnectionPoint(DIID_HTMLElementEvents2, &pCP);
if (SUCCEEDED(hr))
{
hr = pCP->Advise(pUnk, &dwCookie);
if (SUCCEEDED(hr))
{
}
pCP->Release();
}
pCPC->Release();
}
}
pElem would be a frame element in your case.
Hope it helps ... and works;)
|
|
|
|
|
THX!!! are you lucky luke?
im'going to understand your code and try it.
i hope it's works
thx again !
|
|
|
|
|
hmm..
sorry i'm don't understand very well
to get a pointer on frames i do :
IDispatch *pDisp = GetHtmlDocument();
IHTMLDocument2 *pDocument = NULL;
pDisp->QueryInterface( IID_IHTMLDocument2, ( void** )&pDocument );
IHTMLFramesCollection2* pFrames;
pDocument->get_frames(&pFrames);
I don't understand what contains pFrames ?
and to pass IHTMLElement* pElem at ConnectEvents i do :
IHTMLElement* pBody = NULL;
pDocument->get_body (&pBody );
ConnectEvents(pBody);
it's right ?
i'm sorry to ask you so many questions but you are my only help.
|
|
|
|
|
jeremysay wrote:
to get a pointer on frames i do :
Yeah, that should work....
jeremysay wrote:
I don't understand what contains pFrame
pFrame contains a collection of all frames of your document. You can then extract the elements by using the item function that IHTMLFrameCollection2 supports. For details you should hava a look at MSDN.
jeremysay wrote:
and to pass IHTMLElement* pElem at ConnectEvents i do :
As you want to get informed about a frame gaining focus, I think IHTMLElement should be replaced by a pointer to a frame object. So once you have pointers to your frames (as mentioned above retrieved by 'item'), I think you should call ConnectEvents with a pointer to your frame.
jeremysay wrote:
i'm sorry to ask you so many questions but you are my only h
There's no reason to be sorry ... I think I'll learn nearly as much as you when trying to solve your problems ... it's everytime a new challenge;)
|
|
|
|
|
THX !
i try to work your soltion....
Schlaubi wrote:
think I'll learn nearly as much as you when trying to solve your problems ... it's everytime a new challenge
Don't panic I have many challenge for you
|
|
|
|
|
I Am Trying To Convert Any Square/Rectangle Bitmap Into An Irregular Shape Bitmap Using MFC .
Any Ideas .
|
|
|
|
|
It's not physically possible to do this. All bitmaps are a square array of bytes, compressed or otherwise. Can you imagine how much harder it would be to define an irregular path for a bitmap ?
You're probably confused by the fact that many applications use masks to draw bitmaps as irregular shapes. GDI+ handles this for you nicely, you can specify a range of colours not to draw and make the central colour in that range the colour you draw the outline area in. A range is good because if you use a lossy formay like jpg, the pixel values will wander a bit.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
It'd probably be fairly easy to make a bot that'd post random stupid VB questions, and nobody would probably ever notice - benjymous - 21-Jan-2003
|
|
|
|
|
Hi Christian,
I Got The Feeling From Ur Mail That u have Not Got My Point.
u Wrote About Mask's I Am Familar With That Types Of Mask Creation Process And Use It in Our Packages.
But As u Know That We View a Bitmap on Screen As Rect/Square .
But i Have To Make it Look Round This Process Will Surely Have Some Data Loss We Are Ready For That.
if u Have Gone Through Some Graphical Packages Such Photoshop it Has Provision For Irregular Shape Bitmaps .
Regards
Praveen
|
|
|
|
|
All Photoshop does is hide the details from you. There ONLY way Windows can deal with a bitmap is as an array of scanlines, which may or may not be padded, depending on bit depth. They are always rectangular. End of story.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
It'd probably be fairly easy to make a bot that'd post random stupid VB questions, and nobody would probably ever notice - benjymous - 21-Jan-2003
|
|
|
|
|
I was created toolbar using CToolbarctrl.I was used Loadimages for loading the Single Bitmap,having no of different bitmaps.Then I was used TBBUTTON structre.
b[0].iBitmap=0; ie means I was assigned index of the bitmap resource.
This program sucessfully run on WIN98.But while running the on WIN2000
Bitmaps are not appeared on the bitmap.what shall I do?Please tell me
changes?
|
|
|
|
|
Hi,
I work on a project composed with several libs including MFC's and resources on visual c++ V6.0
i have a toto.lib and toto.res that i link with others but i saw that all resources was present in toto.res AND in toto.lib. I would like to trash toto.res and use only resources included in toto.lib but the linker want absolutely toto.res. I can't find a way to link with toto.lib only and load resources from this static lib.
Any solution?
Thanks
|
|
|
|
|
If .lib your are talking about is surrogate created to link to some DLL then you have no choice.
If you are talking about true static lib there could be no resources in it, even though it can reference one.
Anonymous wrote:
load resources from this static lib
This statement is confusing - please clarify what is it you are trying to do?
|
|
|
|
|
Hi,
I have strange problem with my dialog based app.
I use modified PropertySheet/PropertyPages on main dialog
Base is StackDialog by Zoran M.Todorovic, found on codeguru or maybe on codeproject.
In some moment i realized that when I close application, no one get focus.
Alt+Tab combination don't work. Alt+Esc stil can to open start meny, and after that Alt+Tab work well.
Main dialog have added menu, tooltips...
I try to set focus to the previous application in ExitInstance
Question is
1. How to repair application to exit properly
2. How to find which app is behind my app, (in z-order)
e.g. how to force regular exit
thanks for every suggestion
|
|
|
|