|
ActiveX can not be used if without register it.
but you can register it in main program, so it looks not registered - or you can unregister it when main app exists.
MSDN has a sample about how to register ActiveX, just a few of lines, very easy.
I can not remember the sample name - regsrv32 or some name similar to this.
modified on Friday, October 2, 2009 12:08 PM
|
|
|
|
|
regsvr32
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
includeh10 wrote: ActiveX can not be used if without register it.
This is not completely true.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
how so?
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
|
Hi guys,
I've just written a piece of code which works fine and now I need to do one more and the last operation to complete the whole project. I'd like to count how many times all elements in each combination repeat. To be more precise I'm interested in number of occurences which are equal or bigger than six. Here's the code. You can use it for your studies if you want:
#include "IndexCombination.h"
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <iterator>
#include <map>
#include <sstream>
using namespace std;
using namespace stdcomb;
bool GetNextComb(std::vector<unsigned int> &vi);
struct Element
{
char name[6];
int numbers[30];
char chain[90];
};
const Element elements[] = {
{
"ia11",
{3,9,17,21,24,31,33,36,42,49,4,8,19,22,28,30,34,39,43,47,2,6,10,13,14,25,29,37,38,46},
"3,9,17,21,24,31,33,36,42,49,4,8,19,22,28,30,34,39,43,47,2,6,10,13,14,25,29,37,38,46"
}, {
"ia34",
{1,6,12,15,22,27,31,32,41,42,4,7,14,17,23,30,33,36,45,48,2,9,13,18,21,26,34,39,44,49},
"1,6,12,15,22,27,31,32,41,42,4,7,14,17,23,30,33,36,45,48,2,9,13,18,21,26,34,39,44,49"
}, {
"ia72",
{3,8,11,18,22,25,36,37,43,46,1,6,16,17,23,28,35,40,41,44,2,5,12,19,24,27,31,34,42,49},
"3,8,11,18,22,25,36,37,43,46,1,6,16,17,23,28,35,40,41,44,2,5,12,19,24,27,31,34,42,49"
}, {
"ia167",
{3,4,12,15,21,28,32,39,47,48,6,9,16,17,29,30,31,38,41,42,7,8,11,20,26,27,34,35,45,46},
"3,4,12,15,21,28,32,39,47,48,6,9,16,17,29,30,31,38,41,42,7,8,11,20,26,27,34,35,45,46"
}, {
"ia190",
{3,10,11,14,22,23,32,35,43,44,6,9,16,19,24,29,37,38,45,48,2,5,13,18,25,30,31,40,41,0},
"3,10,11,14,22,23,32,35,43,44,6,9,16,19,24,29,37,38,45,48,2,5,13,18,25,30,31,40,41,0"
}, {
"ia21",
{2,5,16,19,25,30,34,39,45,48,1,9,12,13,21,24,33,36,44,49,3,8,15,20,23,26,35,40,43,46},
"2,5,16,19,25,30,34,39,45,48,1,9,12,13,21,24,33,36,44,49,3,8,15,20,23,26,35,40,43,46"
}, {
"ia64",
{6,9,13,20,28,29,33,40,43,48,2,7,16,19,24,27,31,34,44,47,5,8,14,17,21,30,32,37,41,46},
"6,9,13,20,28,29,33,40,43,48,2,7,16,19,24,27,31,34,44,47,5,8,14,17,21,30,32,37,41,46"
}, {
"ia102",
{4,9,14,19,22,29,35,38,46,47,5,8,13,16,21,26,33,40,41,48,6,7,15,17,28,30,32,39,42,45},
"4,9,14,19,22,29,35,38,46,47,5,8,13,16,21,26,33,40,41,48,6,7,15,17,28,30,32,39,42,45"
}, {
"ia178",
{6,9,15,20,23,24,37,38,42,45,7,8,16,19,22,25,34,39,43,46,1,2,17,18,26,29,31,40,47,0},
"6,9,15,20,23,24,37,38,42,45,7,8,16,19,22,25,34,39,43,46,1,2,17,18,26,29,31,40,47,0"
}, {
"ia180",
{1,4,13,18,27,30,33,38,45,46,2,3,12,15,22,23,39,40,44,47,8,9,11,17,24,25,32,37,49,0},
"1,4,13,18,27,30,33,38,45,46,2,3,12,15,22,23,39,40,44,47,8,9,11,17,24,25,32,37,49,0"
}
};
int main(int argc, char *argv[])
{
CIdxComb cb;
cb.SetSizes(10,6);
vector<unsigned int> combination(6);
combination[0] = 0;
combination[1] = 1;
combination[2] = 2;
combination[3] = 3;
combination[4] = 4;
combination[5] = 5;
int Total = 0;
while(cb.GetNextComb(combination))//the compiler stops here
{
Total++;
cout << "Combination number. " << Total << endl;
for (unsigned i = 0; i < combination.size(); i++)
{
const Element &element = elements[combination[i]];
cout << element.name << ": " << element.chain << endl;
}
cout << endl;
}
system("PAUSE");
return EXIT_SUCCESS;
}
I know that only a few lines are needed to achieve the goal. I've read quite a lot on the subject, but somehow can't figure out how to do it.
Can anybody help me ?
|
|
|
|
|
Waldemar Ork wrote:
while(cb.GetNextComb(combination))//the compiler stops here
And what error does the compiler give you when it stops?
What is the output that you are expecting? I'm just guessing, but I don't see any relevance to the name and chain members of the structure. If that's the case, remove them from the problem.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
This comment is out of date, I forgot to remove it some time ago. I'm really sorry.
|
|
|
|
|
Hi all,
Here i am developing VSS Hardware provider, when i am calling the DOSnapshot method from the requestor. VSS is returning with the error VSS_E_HOLD_WRITES_TIMEOUT
Like this
Returned HRESULT = 0x80042314
- Error text: VSS_E_HOLD_WRITES_TIMEOUT
- Please re-run VSHADOW.EXE with the /tracing option to get more details
"http://msdn.microsoft.com/en-us/library/aa382659(VS.85).aspx"
Thanks in advance
Vishwanagh
|
|
|
|
|
Hi,
Can I use DDX_CONTROL instead of create to connect my rich edit control defined in my resource file
thankx
|
|
|
|
|
As far as i can tell from what you wrote here, yes. (Althorough how you would use "create" to connect a member variable to a control defined in your resource puzzles me)
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Isn't the last parm on the ::create the resource id of the
control defined in the resource file I would think that connects it
to the specfic CWnd object
The reason I like DDX_CONTROL is that it would pick up
the demensions of window/control and I don't
have to figure out the values for the CRect
Thankx
|
|
|
|
|
As far as i know the last param of ::CreateWindow (or ::CreateWindowEx if that is what you mean) isn't what you think it is. However, you can use DDX_Control to attach a control variable to your rich-edit easily.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
And it will pick up all the pars from the resorce file
|
|
|
|
|
I'm not sure what you mean by that but probably yes.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Sorry for the delay in responding but had some religous holidays
what I meant was the deminsions of the edit control would be picked up from the resource file defination
plus the style bits e.g. ES_MMULTILINE
After DDX_CONTROL do I still have to a create though ??
thankx
|
|
|
|
|
Then i understood correctly. No, you do not need to create it, it is done for you when you create the dialog (directly by calling Create or indirectly by calling DoModal on the dialog itself), with DDX you simply attach the already exsisting control to your variable.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
When I went stepping thru the DDX_Control
The Cricheditctrl m_hWnd seemed to be intialized
I passed the DDX_Control my Myrichedit data memeber (think I am using the right term)
Since this a call by reference doesn't seem like I should need to do any more before using
the Richedit methods on this object
thankx again
|
|
|
|
|
hi ppl,
I got this framework which obiously includes windows.h...
And I got a static library which includes afxwin.h.
I need afxwin.h because I want to use CCmdTarget class.
And I got this error: WINDOWS.H already included. MFC apps must not #include <windows.h>
I am not creating a MFC application and I need CCmdTarget class and I cannot remove windows.h...
Any workarounds??
Thank you all..
|
|
|
|
|
The CCmdTarget class is part of MFC.
So you don't have the option of not using MFC.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
You can include all the MFC stuff first. This way, you can be sure that windows.h is already included for the framework that comes next.
But, like the other poster said, you are going to be building an MFC application.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
I have been updating an MFC application that has the following line of code in it to create Edit Boxes (Note tmp is a CString object):
CreateEx(WS_EX_CLIENTEDGE, _T("EDIT"), _T(tmp), WS_CHILD | WS_TABSTOP | WS_VISIBLE, *pMyRects[0], pParent, resourceId);
Up until recently, this code has worked fine. On my latest build, only the Debug build works. The Release build crashes. I traced the crash to this particular line of code. The CreateEx function actually never returns. I can't debug it, since as I said the Debug configuration doesn't crash.
What's weird is when I replaced the _T(tmp) parameter with _T("") so the line looks like below, the Release build doesn't crash.
CreateEx(WS_EX_CLIENTEDGE, _T("EDIT"), _T(""), WS_CHILD | WS_TABSTOP | WS_VISIBLE, *pMyRects[0], pParent, resourceId);
I've googled this issue and can't find anything like it anywhere. Does anyone know if there is some issue passing a CString to the CreateEx function or if there's a problem because the CString was created locally in the function?
Another strange quirk is that I ran the Release executable on a machine with Vista (rather than XP which is what I am developing on) and the code doesn't crash.
|
|
|
|
|
Why are you using the _T() macro on a CString ? Try removing it and see if this fixes your problem.
|
|
|
|
|
Sorry, I didn't specify that before, originally I wasn't using the _T macro, I was just passing the CString by itself. That crashed the program too.
|
|
|
|
|
Did you try "tmp.GetBuffer()"?
|
|
|
|
|