I think, you can construct some regular expression to handle such a string parsing.
RegExp is a thingie, where you describe the format of string, it's parts etc. Then it can check if the supplied string matches the specified format, and the library is also able to parse the string for you to parts you specify. It allows you to specify optional parts of string (class specification e.g. FileControl::) and repeating (parameters - there can be zero or X parameters)
There are a lot of available regexp libraries - in ATL7 is one, the class is named I guess CAtlRegExp or something like that. The boost library also provides some regular expression code.
Later on, when you will be happy with the construct, there are some tools around 'compiling' the regexp expression to the plain C (you will get some speedup)
i work with CHtmlView in MDI project and i want to stop Popup window, so i do : void CBrowserMDIView::OnNewWindow2(LPDISPATCH* ppDisp, BOOL* Cancel)
// TODO : ajoutez ici votre code spécialisé et/ou l'appel de la classe de base
*Cancel = true;
but with this code i block all new window, if the user click on link which open a new window, it is stoped by *Cancel = true;.
So how can i distinguish if OnNewWindow2 is called via script or by click ??
Neville Franks wrote: I don't know if OnBeforeNavigate2() is called for popup windows, but if it is you can do the cancel there based on the lpszURL param.
ok but how know if it is a desired popup (click on link) or a ad popup ?
could you more explain please
I have a application with a view that has a tabctrl. The tabpages of this tabctrl are CDialog derived objects. There a several dll's that draw controls on these tabpages (I didn't think this up, my predecessor did ).
Anyhow, the problem is that some of the controls do not receive their messages. E.g. button controls do not receive BN_CLICKED, the same account for spinctrl's. But I can edit the fields of a editctrl. Also when I create an ownerdraw button the WM_DRAWITEM message can not be received.
When I create a similar control in the application itself then this control does receive it's messages. My predecessor create a 'sollution' by overriding the OnCommand of the TabCtrl. This does solve the BN_CLICKED problem but still I do not receive the ownerdraw messages. Anyone got a clue about how to solve this?
Search MSDN for IActiveDesktop interface, it has got methods which help you change the background of Desktop.
<edit> I was assuming you where asking about changing desktop background image, if you want to paint your apps window with images, then you
can override OnDraw if its a CView based app. to start with </edit>
I have a DLL written in Microsoft C 6.0 to be called by VB 6.0 main program. The VB 6.0 main program is compiled into an exe and copied to the DEBUG folder containing the DLL. When VC debug mode is started, a popup with exe not found is displayed even the VB exe exists in the folder.
Previously the VC Debug does function properly but all in a sudden the debug does not work. Please advise.
I'm breaking up a large application into some DLLs, and I'm having trouble with some dialogs. The DLLs are linked to the app implicitly, and use MFC in a shared DLL (in debug).
The problem is that dialogs internal to the DLL don't appear when I call DoModal(). By tracing the code, I've found that it can't load the dialog template, so the dialog fails to load. I've searched MSDN, but I haven't found anything that deals with dialog resources in an implicitly linked DLL.
What am I doing wrong? Do I have to do something to export the dialog template (and any other resources) when I compile, or do I need to do something in the linking application?
I am basically doing what you've suggested, with two important differences that I can see:
1) The function headers are not 'extern "C"' I just use the regular C++ definitions. I don't think that affects my project, since everything uses C++.
2) The function headers used by the app are not declared __declspec(dllimport). Would this prevent the dialog resources from showing? I doubt it, since the functions I call work just fine.
I can call all the functions I export no problem, without 'extern "C"' or __declspec(dllimport). Yes, the lib is imported into my project (so the dll is loaded implicitly). Basically, my code looks very similar to yours:
I've figured out what the problem is. Basically, the DLL needs to load the resources, and then properly set the resource source before you need to load one, such as when you want to load a dialog template.
This is not a question or cry for help.
Rather, I wondered if anyone would be interested in some code that performs adaptive histogram equalization (AHE in imaging circles). If I see enough demand for it, I'll dust off some old code, wrap it up into a nice demo app and submit it as an article.
For those not familiar with the imaging field:
AHE is an algorithm to enhance the contrast of an image.
Here is some background info:
I code C++ for unix at my job. I have my directory shared via samba to my windows desktop. I have VS setup to use as my IDE.
Here is one question:
We save our files as *.cc instead of *.cpp and VS doesn't recognize this as a C++ file therefor I get no syntax highlighting and all that other cool stuff. Is there a way to add an extension (*.cc) to the list of C++ files?
Here is another question:
I added another folder to my project called libs where I put all of our classes. We have a class called Cstring and if I type Cstring:: it will pop up the box with all of member functions associated with that class. But if I do something like Cstring str; then type str. it does not pop up that nifty little box. Anyone know how to fix this? (Note: I am not actually compiling the files on my windows machine. Just saving them and then compiling on my unix term.)
Thanks in advance,
There are 10 types of people in this world, those that understand binary and those who don't.
I have encountered your
Cstring::/ Cstring str / str. problem with the autocomplete
as well. Sometimes I find it works for non-C++ native classes and sometimes it doesn't. I suspect that it is a bit flakey.
Unfortunately I cannot help you, but would appreciate anyone else's input who can shed some light on this...
To force a file to be recognised as C++, use the /Tp option in your settings. Of course, you'll need to create a dummy project to have settings - put all your .cc files into it, and VC should be happy (it may even provide intellisense for you)
So. I build ansi - fine. I build UNICODE and I get this: Main.obj : error LNK2019: unresolved external symbol "void __cdecl SalieriFoundation::Globals::Func(class std::basic_string < unsigned short,struct std::char_traits < unsigned short > ,class std::allocator < unsigned short > > const &)" (?Func@Globals@SalieriFoundation@@YAXABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@@Z) referenced in function _main
Edit: as asked by first reply changed the linker error message - added some spaces to avoid HTML-like text. Also I actualy have namespaces that you can see in the error message so I added in the above sample code - but I don't think it makes any diff.
What's wrong? _UNICODE is defined in both projects.
I'm tying to find it for like 6 hours. Please help.
Are you sure it is linking with the unicode version of the static library? If both the unicode and ansi versions have the same filename (which is never a good idea), then it is possible that it is finding the ansi version first, and so never finding your unicode version of the function.
Have you seen Michael Dunn's article on Custom-Draw in List boxes? It's on this site (can't find link - it's entitled "Neat Things to do with CListCtrl using Custom Draw") - I have successfully followed that example to colour my List Box