|
narayanagvs wrote:
1)I would like to know what it does internally? Where does it store the GUID for comparing?
The source code to regsvr32 is here:
INFO: How Regsvr32.exe Registers and Unregisters COM DLLs[^]
Ultimately the COM interface information is stored in the registry database:
HKEY_CLASSES_ROOT\CLSID
HKEY_CLASSES_ROOT\AppID
HKEY_LOCAL_MACHINE\Software\Classes\CLSID
HKEY_CURRENT_USER\Software\Classes\CLSID
narayanagvs wrote:
2)I would like to know where else can we save strings in windows other than files and registries.
I dont understand the question, the registry is also a file. Are you asking where to save information other than a hard drive.
Best Wishes,
-David Delaune
|
|
|
|
|
Hello
I have a menu class derived from CMenu whose purpose is to change the menu of the FrameWindow according to the childwindow which is done fine. But through the CMenu class can I add Alt key buttons or accelerators.
Prithaa
|
|
|
|
|
Erm... Doesn't MFC do what you're asking for automatically?
In an MDI program, you'll see a pMainFrame->LoadFrame (IDR...) line, which tells MFC which menu to use when you have no document loaded (and hence no childframe).
Next, you'll have a template being loaded, and the first parameter of the new template is a resource ID, which points to (among other things) a menu ID to use when that template is in action.
If that's all your custom menu class does, I think you can get rid of it...
As for alt keys, that's only partly the job of the menu. If you use the & key in front of a menu title (eg, &File), then that key will be highlit, and pressing Alt-F will bring up the file menu. Then you can do the same for menu items (ie, &Open), and then you can use Alt-F followed by O to use the file open menu...
For hot keys, (ie, Alt-f3 being file open), you need to set the accelerator table.
For more complex things, like adding accelerator values automatically to the menu, and toobar buttons also, have a look at the following article. It may be over the top, but it's very good!
http://www.codeproject.com/KB/menus/newmenuxpstyle.aspx
Owner Drawn Menu with Icons, Titles and Shading[^]
Good luck,
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!
|
|
|
|
|
I have problem in style or appearance of the Menu bar and document in document view architecture.
In my application the document is dipped inside compare to menu bar (example if you open a notepad u can identify the menu bar is some what high and document is slightly dipped inside)
But I need the appearance the document should be high compare to menu bar (Example if open windows calculator u can see the document is high compare to menu bar)
Please give me suggestion to do this and is this possible to do in SDI or MDI architecture?
|
|
|
|
|
I don't know if I fully understand you, but you could try to remove the client edge style in the view class.
ModifyStyleEx(WS_EX_CLIENTEDGE, 0);
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
I had tried already , I removed client edge in style itself, even if we put thick frame style we are not getting the result
|
|
|
|
|
I actually tried it in OnInitialUpdate function of the View class and it worked.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
i have the following code to print the input and the output of 2 deifferent classes / fileds when i click the : print output or print input the programm comes to the function PrintOutput or PrintInput inside these 2 functions i have this code line to reset the cursor
position in the right filed which content to be printed and set the windows message to ID_FILE_PRINT which is in the normal case the element to be clicked in order to call OnFilePrint(). when i use OnFilePrint()indicators get an Assert debug failure because hDC is not intialized, i do not kn ow if this is the right way to solve this problem.
this is in the file sql_input.cpp
void CSQL_Input_View::OnPrintInput ()
{
m_wndSplitter.SetActivePane(0,0,0); // reset cursor position
PostMessage (WM_COMMAND, ID_FILE_PRINT);
//CEditView::OnFilePrint();
}
and this is in the file sql_output.cpp
void CSQL_Output_View::OnPrintOutput ()
{
m_wndSplitter.SetActivePane(1,0,0); // reset cursor position
PostMessage (WM_COMMAND, ID_FILE_PRINT);
//CEditView::OnFilePrint();
}
Any help would be appriciated.
|
|
|
|
|
Here the code of a "pulsar" in Qt context. QMTPulsar is an abstract class used for execution of periodic switches, and execute a function at the end of each period. The compilation message is given.
Best regards.
> QMThreadOneAction is used to run asynchronously a function;
La création des QMThreadOneAction est incorrecte.
//-------------------------------------
/** QMTPulsar.h
> Pulse component
- mechanism of periodic (or not) raise and fall call
*/
#ifndef __TESTUTILS_H__
#define __TESTUTILS_H__
#ifdef DEVICELOADER_EXPORTS
#define DEVICELOADER_API __declspec(dllexport)
#else
#define DEVICELOADER_API __declspec(dllimport)
#endif
#include "QtCore/QtGlobal"
#include "QtCore/QThread"
#include "MTDevicePrv.h"
//-------------------------------------
/** QMTPulsar
> process up and down switches, and function execution at each switch.
*/
class DEVICELOADER_API QMTPulsar :
public QThread
{
//-------------------------------------
/** QMThreadOneAction
> execute asynchronously a function
*/
class QMThreadOneAction :
public QThread
{
private:
MTDevicePrv *_device;
void (__cdecl* QMTPulsar::_fonc)(MTDevicePrv *dev);
bool _running;
//! execute function once
void run(void)
{
if (_fonc) {
if (!_running) {
_running = true;
try {
_fonc( _device);
}
catch(...){}
_running = false;
}
}
}
public:
//! constructeur
QMThreadOneAction (
MTDevicePrv *dev,
void (__cdecl* QMTPulsar::fonc)(MTDevicePrv *)
)
{
_running = false;
_device = dev;
_fonc = fonc;
}
//! execute asynchronously function
void go( void) {
run();
}
};
private:
MTDevicePrv *_device;
//! start with action or not
/**
_startWithAction = false
F1 F2
_______________
D1 | D2 |
__________
_startWithAction = true
F1 D1 F2
_______________
| | D2
__________
*/
bool _startWithAction;
//! D1 (microsecond)
qint64 _firstDurationMUS;
//! D2 (microsecond)
qint64 _secondDurationMUS;
//! repeat mechanism
bool _periodic;
//! is operating
bool _active;
QMThreadOneAction *_thFirst;
QMThreadOneAction *_thSecond;
//! processing
void run() {
do {
if (!_active) {
QThread::yieldCurrentThread();
}
else {
if (!_startWithAction) {
QThread::usleep( _firstDurationMUS);
_firstAction();
QThread::usleep( _secondDurationMUS);
_secondAction();
}
else {
_firstAction();
QThread::usleep( _firstDurationMUS);
_secondAction();
QThread::usleep( _secondDurationMUS);
}
}
} while( _periodic);
};
//! first action call to implement
void _firstAction( void) {
_thFirst->go();
}
//! second action call to implement
virtual void _secondAction( void) {
_thSecond->go();
}
public:
//! first action call to implement
virtual void fnFirstAction( MTDevicePrv *dev) = 0;
//! second action call to implement
virtual void fnSecondAction( MTDevicePrv *dev) = 0;
/** create pulsar
@param startWithAction start immediately firstAction or not
@param firstDurationMUS first delay in micro sec
@param secondDurationMUS second delay in micro sec
@param periodic periodic or not
@param startActive start activity immediately
*/
QMTPulsar(
MTDevicePrv *dev,
bool startWithAction,
qint64 firstDurationMUS,
qint64 secondDurationMUS,
bool periodic,
bool startActive)
{
_device = dev;
_startWithAction = startWithAction;
_periodic = periodic;
_firstDurationMUS = firstDurationMUS;
_secondDurationMUS = secondDurationMUS;
_active = startActive;
/* error #171)*/ _thFirst = new QMThreadOneAction( _device, fnFirstAction);
/* error #172)*/ _thSecond = new QMThreadOneAction( _device, fnSecondAction);
/*
Compilation en cours...
QMTPulsar.cpp
c:\_projets-cpp2008\deviceframework\deviceframework\devicemanager\qmtpulsar.h(171) : error C3867: &'QMTPulsar::fnFirstAction' : liste d'arguments manquante dans l'appel de fonction ; utilisez 'QMTPulsar::fnFirstAction' pour créer un pointeur vers membre
c:\_projets-cpp2008\deviceframework\deviceframework\devicemanager\qmtpulsar.h(172) : error C3867: &'QMTPulsar::fnSecondAction' : liste d'arguments manquante dans l'appel de fonction ; utilisez 'QMTPulsar::fnSecondAction' pour créer un pointeur vers membre
Le journal de génération a été enregistré à l'emplacement "file://c:\_Projets-CPP2008\DeviceFramework\DeviceFramework\DeviceManager\src\Debug\BuildLog.htm"
DeviceManager - 2 erreur(s), 0 avertissement(s)
*/
run();
};
~QMTPulsar();
//! return owner device
MTDevice* getDevice() const {
return _device ;
}
//! activate (if true) mechanism
virtual void activate(
bool active) {
_active = active;
if (!QThread::isRunning())
run();
};
};
#endif
|
|
|
|
|
I think you are talking about a callback function?
See here[^]
|
|
|
|
|
Hello,
not exactly (see the first sample, and the principle here :
class ClassACTION {
class ClassExecute {
private:
//pointer on function
void (*_func)( string s);
public:
ClassExecute( void (* func)( string s) { _func = func; }
void go() { _func( "hello"); }
}
private:
ClassExecute *_Executor;
public:
void myFunction( string s) { cout << s << " friend." << endl; }
ClassACTION() {
_Executor = new ClassExecute( myFunction); <<< here is the problem (does'nt compile)...
_Executor->go();
}
};
Best regards.
|
|
|
|
|
You need to use &class-name::fnFirstAction and &class-name::fnSecondAction , where class-name is the class that implements those methods.
You don't appear to have any implementation of the methods, though - the only definitions of those two methods that I can see is the abstract method declarations in QMTPulsar - i.e. the following two lines:
virtual void fnFirstAction( MTDevicePrv *dev) = 0;
virtual void fnSecondAction( MTDevicePrv *dev) = 0;
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hello,
I have a STL map and string values as the key values However recently, i want to search this map as it is like auto-complete ComboBox.
For example,I have keys in the map as such Apple, Pearl, Orange.
When i enter 'A' i want to return Apple from the map.
I know that i can iterate thorough each map object and compare its key, but i think that would inefficient.
Any ideas ?
Bekir.
|
|
|
|
|
Use std::map::lower_bound . For example, the program below gives you a pair of iterators defining the range containing keys starting with 'A':
#include <string>
#include <map>
#include <iostream>
int main(int, char**)
{
std::map<std::string, int> a;
a.insert(std::make_pair("Apple", 1));
a.insert(std::make_pair("Banana", 1));
a.insert(std::make_pair("Pear", 1));
a.insert(std::make_pair("Apricot", 1));
a.insert(std::make_pair("Plum", 1));
std::map<std::string, int>::const_iterator low = a.lower_bound("A");
std::map<std::string, int>::const_iterator hi = a.lower_bound("B");
for(std::map<std::string, int>::const_iterator it=low;it!=hi;++it)
{
std::cout << it->first << std::endl;
}
}
Note that the sample key for the second lower_bound call is just the key you're looking for with the last character incremented by one.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thank you, this is what i was looking for
Bekir.
|
|
|
|
|
Doesn't this require the elements to be sorted?
|
|
|
|
|
It's a std::map - by definition, it's sorted.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
You are right. maps do it.
|
|
|
|
|
i need from vc++ program get a list of dll (there are in one folder, "plugins"), from choosen dll get a list functions and run them. it's deficult? write some code to do it
modified on Wednesday, April 8, 2009 3:04 AM
|
|
|
|
|
In general, I'd look for a known set of functions, rather than trying to get a list of functions in the DLL - after all, you need to know how to call the functions, if they're plug-ins?
So - the first task is to design your plug-in interface so it's generic enough to do what you want.
Once you've done that, it's relatively easy to iterate through the files in a directory (look at the FindFirstFile[^] documentation), see if they're DLLs (LoadLibrary[^]) and see if they have the function you want (GetProcAddress[^]).
Now, if you really want to list the functions exported by a DLL, you need to read the internal structure[^] of a DLL, to get its export table. There's a short program to illustrate that here[^] - look for the last post on the page.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
|
No you are wrong. It's called "CodeProject".
|
|
|
|
|
XDDDD good one
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
No. You are an absolute idiot if you think anybody here is going to give up their time in order to do your project for free. If you want the project, then pay for it. On another website. Stop posting ridiculous queries which drown out the legitimate, intelligent questions which have been posted
|
|
|
|
|
hai i need a complete code for our project .. interactive voice response system using vc++(MFC) .. please help me
|
|
|
|
|