|
Better check again on the OCX. What you are describing is the result of either not having the control or not have having it registered. MSCHRT20.OCX must be on your Win 95 box. You just need to copy the control over and call from a DOS prompt: "regsvr32 mschrt20.ocx" (possibly including the path and all that). MSCHRT20.OCX is provided by the installation of Visual Studio and it's Service Packs. Therefore you will need to include it. You will also likely want to make sure that your 95 box has the latest IE installed (at least 4.0). Otherwise you'll have to find and install the latest Common Controls (which IE does for you).
Good luck.
|
|
|
|
|
Thanks for the response. I have IE 5.0 installed on the box. I also installed Visual Studio completely on the box. I can also use the chart control in VB app without problem on the same box. The control also shows up in the Insert ActiveX control dialog. Which I believe indicates that the control is correctly installed, including the design time license.
TIA!
Nate
|
|
|
|
|
When you say "The Box" are you talking about the Win2K development box, or the Win95 box you are having the trouble on? Maybe I misunderstood, but I thought you developed on Win2K with no problems but the program blew on Win95... What I'm saying is that to run the program on any other box, you have to include both the EXE (program) and the OCX (registered).
|
|
|
|
|
The app / control works fine on W2K where it was developed. The app crashed Win95 to a blue screen. As part of the troubleshooting process I then installed Visual Studion on the Win95 machine that was crashing. The application still crashed the OS. I wrote a sample VB that displayed the chart correctly on the Win95 machine, no crashes. I wrote a simple ATL app that had the chart in a dialog, it still crashed the app. If I take the control out of the dialog, the ATL app runs fine. I can add other ActiveX controls to the ATL app and the dialog shows correctly, the calendar control for example. One difference I noticed is that the chart control is marked as single threaded while the calendar control isn't? Is this a threading issue? I did try the ATL app on Windows ME machine, while it didn't crash the OS, an error was displayed where the chart should have been. Any further ideas?
TIA!
|
|
|
|
|
Well, I got into some reading on this and learned a few new things.... though all it LOOKS like I can do is POSSIBLY point you in the right direction (I will, however, probably try this myself in a little while). At any rate, the gyst of this problem MIGHT be the following:
....
Most of the Microsoft OCX's (and many others, too) are *licensed*. There are
two types of licenses: Runtime and Development license. The runtime license
is hardcoded in the control (If you build a control using Visual Basic, you
can set the property "license required", for example). The Development
license is stored in the registry.
The control does two things if it's called. First it checks wether it was
called with the correct license key given by the calling application as a
parameter(runtime license). If this fails it looks into the registry for the
development license. If this fails too, an error is produced, and the
control does not show up (this is, what happens on your client PC)
If you build an Visual Basic Application which uses one of these licensed
controls, Visual Basic knows that this control needs a license and
integrates it into the application. The application initializes the control
now with the correct license key.
UNIFACE can't do this. The OCX license is not integrated into the UNIFACE
application. Therefore the control looks for the development license, which
isn't installed on your client PC's.
....
Good luck.
Matt
|
|
|
|
|
Heh, oops. Now I'm replying to myself...
Anyway, the deal is (I think) that the Microsoft Chart Control seems to come from basically, 2 separate places (that I know of). If you set it up as follows, you SHOULD get the license (which I think is just a registry key) set up for you so everything works normally.
1) Install Office which sets up everything you need though obviously we can't make that a requirement!
2) Install Visual Basic... I know you said you installed Visual Studio on the 95 box... but did that include VB? Theoretically this control is part of the VB package.
Also, read a little about licensing from here:
http://groups.google.com/groups?hl=en&lr=&safe=off&ic=1&th=23637427a52818fd,3&seekm=981994291.815525%40callisto#p
Matt
|
|
|
|
|
Hum... never looked into the license issue. Yes I installed VB, VC++, and the "Additional ActiveX controls" from the VS install. Terminating the OS seems to be a harsh failure for not having the correct license I would be very interested to see if it works for you!
Thanks!
|
|
|
|
|
I'll take a look. As for the BSD, I'll bet that's just because Windows 95 sucks. Still, I'll give it a shot myself and see what happens.
|
|
|
|
|
Thanks! I would be happy to send you sample code tonight if that makes it faster for you.
nwilhelmi@home.com
|
|
|
|
|
Sure, go ahead. Better send it to mphilmon@noregon.com instead of my address on here. My DSL line is down right now and I'm actually having to use Dial-up access at home. I work at Noregon so their T1 will be a much easier download.
|
|
|
|
|
I'm trying to make Chris's grid control support Unicode copy / paste operations. I've got paste working fine but I can't figure out the copy... The relevant function is below with the parts I've modified in the #ifdef, #endif blocks... It copies the first part of a string but then gets garbeled. Also, if I copy from multiple cells, everything is pasted into a single cell. Where am I going wrong here (I'm guessing I'm not converting between ANSI / Unicode somewhere and mixing the two in the same buffer - but where)
Changing the CacheGlobalData() parameter from UNICODETEXT to just TEXT fixs the formatting problems, but isn't what I'm looking for (for obvious reasons). I'm pasting between my app and Excel and vice versa using Arial Unicode MS font...
Any help much appreciated...
COleDataSource* CGridCtrl::CopyTextFromGrid()
{
USES_CONVERSION;
CCellRange Selection = GetSelectedCellRange();
if (!IsValid(Selection))
return NULL;
if (GetVirtualMode())
SendCacheHintToParent(Selection);
CSharedFile sf(GMEM_MOVEABLE | GMEM_DDESHARE | GMEM_ZEROINIT);
CString str;
CGridCellBase *pCell;
for (int row = Selection.GetMinRow(); row <= Selection.GetMaxRow(); row++)
{
if( m_arRowHeights[row] <= 0 )
continue;
str.Empty();
for (int col = Selection.GetMinCol(); col <= Selection.GetMaxCol(); col++)
{
if( m_arColWidths[col] <= 0 )
continue;
pCell = GetCell(row, col);
if (pCell &&(pCell->GetState() & GVIS_SELECTED))
str += pCell->GetText();
if (col != Selection.GetMaxCol())
str += _T("\t");
}
if (row != Selection.GetMaxRow())
str += _T("\n");
#ifdef _UNICODE
sf.Write( str, str.GetLength() );
#else
sf.Write(T2A(str.GetBuffer(1)), str.GetLength());
str.ReleaseBuffer();
#endif
}
TCHAR c = '\0';
sf.Write(&c, 1);
if (GetVirtualMode())
SendCacheHintToParent(CCellRange(-1,-1,-1,-1));
DWORD dwLen = (DWORD) sf.GetLength();
HGLOBAL hMem = sf.Detach();
if (!hMem)
return NULL;
hMem = ::GlobalReAlloc(hMem, dwLen, GMEM_MOVEABLE | GMEM_DDESHARE | GMEM_ZEROINIT);
if (!hMem)
return NULL;
COleDataSource* pSource = new COleDataSource();
#ifdef _UNICODE
pSource->CacheGlobalData(CF_UNICODETEXT, hMem);
#else
pSource->CacheGlobalData(CF_TEXT, hMem);
#endif
return pSource;
}
|
|
|
|
|
This might be it:
sf.Write(str, str.GetLength() * sizeof(TCHAR));
|
|
|
|
|
Bingo. Can't believe I missed that... Thanks!
|
|
|
|
|
I have created an SDI application with an extensive dialog-based interface for a project at work.
I would like to create a new SDI application and import my existing interface classes and dialog GUIs. Is this possible?
Is there a dialog "import" capability in VC++ that I could use to load existing interfaces into a new project, or do I have to directly edit any files?
Thanks,
Kim Rudeen
|
|
|
|
|
I always copy and paste from the .rc and resource.h files to move dialogs between programs. You can also specify extra resource files, but I've never really learned how because it seemed messy and getting dirty with the text files gives me a feeling of control that appeals to my rapidly dwindling sense of manhood.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
Hello,
I have a simple Dialog Box with 2 Timers. One displays the current time ,the other is a Count down timer. When the count down timer reaches a certian time I would like it to display a simple MessageBox.. Here is a sample of the OnTimer(UINT nIDEvent)code where I think I should place the code to display the MessageBox..
void CTimerDlg::OnTimer(UINT nIDEvent)
{
//Which timer triggered this event?
switch (nIDEvent)
{
//The Current Time?
case IDC_TIMER1:
//Display the current time
m_timer1.DisplayCurrentTime();
break;
//The Count Down Timer?
case IDC_TIMER2:
//Increment the count
m_iCount--;
//format and display the count
m_timer2.Display(m_iCount,iM,iH,iD,(CString)m_strTimer2="%D:%H:%M:%S");
break;
}
UpdateData(FALSE);
CDialog::OnTimer(nIDEvent);
}
Any Ideas would be appreciated!!!
THANKS!
Rob
|
|
|
|
|
You might like to put UpdateData() at the top of this, I assume the variable being decrimented is in a dialog box ? Apart from that, it's self evident. Check the timer variable for the value you want, and pop up the dialog if it matches.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
Thanks, I put the UpdateData(TRUE); at the top of this. I have tried several different ways of Checking the timer variable for the value I want but none seem to trigger the event.. I assume I have to compare the m_strTimer2 CString to a CString variable.. here is just one of the ways I have tried.. (Don't laugh.. I'm new at this)
Here is a portion of the code...
.
.
.
case IDC_TIMER2:
//Increment the count
m_iCount--;
//format and display the count
m_timer2.Display(m_iCount,iM,iH,iD,(CString)m_strTimer2="%D:%H:%M:%S");
break;
}
if(m_strTimer2 == "55") // Which I believe is 55 seconds..
{
MessageBox("15 Seconds");
}
UpdateData(FALSE);
CDialog::OnTimer(nIDEvent);
}
Thanks,
Rob Jones
|
|
|
|
|
> Thanks, I put the UpdateData(TRUE); at the top of this. I have tried several different ways of Checking the timer
>variable for the value I want but none seem to trigger the event.. I assume I have to compare the m_strTimer2 CString
>to a CString variable.. here is just one of the ways I have tried.. (Don't laugh.. I'm new at this)
Don't worry - I almost never laugh ( I was once new at this, too )
Here is a portion of the code...
.
.
.
case IDC_TIMER2:
//Increment the count
m_iCount--;
//format and display the count
m_timer2.Display(m_iCount,iM,iH,iD,(CString)m_strTimer2="%D:%H:%M:%S");
break;
}
if(m_strTimer2 == "55") // Which I believe is 55 seconds..
{
MessageBox("15 Seconds");
}
UpdateData(FALSE);
CDialog::OnTimer(nIDEvent);
}
Why compare the string ? It's never going to *equal* 55, if it's formated to include other characters like ':'. You need in the least to say
if (m_StrTimer2.Left(2) == "55")
and I would tend to ignore the formatted string and do comparisons on the integers you used to format the string in the first place.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
I am unable to use comparisons of the intergers because I set the int's value through edit boxes on the dialog application.. e.g (If I want to start the count down timer at 1 day, 1 hour and 1 minute I have 3 edit boxes that I put the information into).I use "void CTimerDlg::onChangeEditBox1()" UpdateData(TRUE); to allow me to input values into the edit boxes. Then onStartTimerButton takes the values from the edit boxes and puts them into the string..etc.. If I look for a change in a int it seems to only trigger when the value is equal to the edit box and I click start timer..not sure what to do.. I tried the m_strTimer2.Left(2) == "55" but that doesnt seem to work either...
Thanks,
Rob Jones
|
|
|
|
|
When you call UpdateData at the top, it pulls down the values into the variables. It's often a good idea to use <= if the value is decrementing rather than ==. There is no reason why, if you call UpdateData properly, you cannot do comparisons on this variable, in the same way you are passing it to a formatting function. It's probably time for you to do some tracing and see what is going on.
If you type TRACE("%d %s\n\r", m_timer(whatever it's called), m_StrTimer); and debug, you will get an output that shows you the values you are dealing with. That should give you a good idea why the values are failing to compare, both as a string and an integer.
Also, if you made the time a float, it will never *equal* 55, it will simply be less than 56 Other than that, without having the source here, I'm not sure what is going on.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
Thanks for all your help!;)
Rob Jones
|
|
|
|
|
The m_strTimer2 String all ways seems to equal 0.. any ideas?
Rob Jones
|
|
|
|
|
I have a section of code that loads winspool.drv (at least I think that's what it's called). Due to what is going on at the time, this results in a bothersome performance hit. Is there a way to load this driver in earlier?
Thanks.
Paul Ebert
|
|
|
|
|
How do you stop a button from becoming 'default' (the thick black line around it) when it is clicked on?
|
|
|
|