[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Flexgrid control can't be created on machines that haven't VC6 installed?

Posted on 2001-06-21
10
Medium Priority
?
453 Views
Last Modified: 2013-11-20
Hi everybody,

    I want to use the MSFlexGrid control in a doc/view vc++ program. The
control shows up perfectly on my machine, which has Visual Studio 6.0
installed. However, on those machines that don't have VS6 installed, the
control doesn't show up at all, even it I have the same control registered
on it.

    I first inserted this control to the project by using the Projects->Add
to Project->Components and Controls menu item. The IDE automatically created
the CMSFlexGrid class. Then I added a member variable to the view class:

     CMSFlexGrid m_grid;

And in the view's OnCreate() method, I addded this code:

int CSView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
 if (CView::OnCreate(lpCreateStruct) == -1)
  return -1;

 // TODO: Add your specialized creation code here
 CRect rc(10,10,300,200);
 m_grid.Create("gird","gird", WS_CHILD|WS_VISIBLE, rc,this, 101); // this
line


 return 0;
}

The control showed up on my machine. But it just couldn't be created on
those machine that haven't vs6 installed. The m_grid.Create() always returns
false, according to a debugging test.

Wierd is that if I just added the control to a dialog based application, and
added a member variable for the control using the class wizard, that is, let
the framework to do the things for me, the flexgrid control always shows up,
whether on my computer or on those.

Anybody could give me a hint? I'm really bewildered at this. Thank you very
much.

Best regards,
Allan
0
Comment
Question by:xiexiao
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
  • +2
10 Comments
 

Expert Comment

by:Andrian
ID: 6217239

you need to add some staff to the others machines:4 at least(mfc42d.dll,msvcrtd.dll,mfco42d.dll)
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 6217303
Be sure you are trying to run the Release version of your code.  The other machines may not have the correct versions of the debug libraries.

On your computer, run the program (Debug version) and watch the trace screen.  It will show a list of all DLLs that are used and needed by your program (its dependencies).  Look at the file names very closely. All of these files must exist on any computer on which your program is executed.

-- Dan
0
 

Author Comment

by:xiexiao
ID: 6220751
Shouldn't the program pop up a dialog box that certain dll can't located if the files are missing?
But it did not appear on the machines.
Any comments?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 49

Expert Comment

by:DanRollins
ID: 6221105
>>Shouldn't the program pop up a dialog box...
No, but in some cases, the system will do so.  In other cases, such as OCX's and their dependencies, or when LoadLibrary API is used, there will be no popup message uless the programmer provided it.

-- Dan
0
 
LVL 2

Accepted Solution

by:
Chandra V earned 400 total points
ID: 6223579
Hai xiexiao,

Some of the redistributable controls supplied with Visual C++ 6.0 are licensed and require a license key to be dynamically created on machines that have not had Visual C++ installed, 'msflxgrd.ocx' is one of them. To get your problem solved see the following MSDN articles.

http://support.microsoft.com/support/kb/articles/Q151/8/04.ASP

http://support.microsoft.com/support/kb/articles/Q151/7/71.ASP
0
 

Author Comment

by:xiexiao
ID: 6227432
That's it! cvallabhaneni.

The reason that the dynamic creation failed is that these controls need license keys!

The reason that the dialog based application is immune to this problem is that the resource editor has already got the license keys via IClassFactory2 interface and cached the license keys in .rc files, and it use them to create those controls.

Thank you very much, cvallabhaneni!

Best regards,
xiexiao
0
 

Expert Comment

by:acheive
ID: 6574883

Hi all,


I have an mdi application and i am hving the msflexgrid in my dialog box, but it is just not showing up on some machines. i used some because the dialog box pops up well and the whole thing works in some computers, but on some the dialog is not at all popping up!!...all of these machines are vc 6. The Wierdest thing is  it was working on a particular machine and suddenly it is not on the same!!...any comments on this please, infact any comment and suggestions are very very much appreciated, i am trying to find out the reason, why working suddenly aint working!!!!

Thanks all
0
 

Author Comment

by:xiexiao
ID: 6577974
Hi acheive,

This is due to the licence problem. When you create the msflexgrid control, you should specify it's license key. You may look up for IClassFactory2 for more inforamation related to this issue.

Are you sure it didin't come up in a Dialog-based application, not SDI or MDI apps?

Xiexiao
0
 

Expert Comment

by:acheive
ID: 6581096

yeah I am pretty sure!!...tell me how did you go about including the msflexgrid...I want to compare yours and mine, cos you said on dialog based it was workin!
0
 

Author Comment

by:xiexiao
ID: 6595556
Actually, some MS ActiveX controls require license key when they are created. However, you may also use the IClassFactory2 interface to get the license key out. When you insert such controls in dialog, the VC++ IDE will automatically query out the license key and save it somewhere and when the dialog is created, the license key will be automatically used.

But when you create SDI or MDI apps, things are different. You need to query out the license key using some other programs and then hard-code it into your apps' Create method. Otherwise the control won't be created successfully.
0

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question