Solved

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

Posted on 2001-06-21
10
427 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
  • 4
  • 2
  • 2
  • +2
10 Comments
 

Expert Comment

by:Andrian
Comment Utility

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
Comment Utility
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
Comment Utility
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
 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
>>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 100 total points
Comment Utility
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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:xiexiao
Comment Utility
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
Comment Utility

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
Comment Utility
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
Comment Utility

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
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Powershell based monitoring system 2 126
Use of condition with 'serial' in ansible 2 35
noX challenge 17 75
wordcount challenge 11 71
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now