|
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?
|
|
|
|
|
you can modify the style of button by removing the BS_DEFPUSHBUTTON style
DWORD style=btn.GetButtonStyle()
style&=~BS_DEFPUSHBUTTON;
btn.SetButtonStyle(style);
|
|
|
|
|
I would like to know how can we handle messages from a child control, for example if a build a custom control that inside I create two edit control how I handle messages from both edit independently?
If I add an ON_EN_UPDATE or ON_EN_CHANGE handler it's ok for one edit but not for two.
Thanks for any help.
|
|
|
|
|
Using ON_EN_UPDATE is fine for two. They both have unique ID's so the messages can be mapped to unique functions.
Michael A Barnhart
mabtech@swbell.net
|
|
|
|
|
I have an MFC MDI application that works fine. I'm trying to add another window, outside of the main MDI window. When I create the child view for this 2nd window, a new blank view appears in the main MDI window, leaving the 2nd window frame blank. The frame, and view class are different for the 2nd window. I've tried tracing through the code and I can't figure out how the main window takes my new child window. There's something built into MFC that is causing this. What am I missing, how can I work around it? Naturally, I can create the window and ignore the frame/document/view architecture, but I'd rather not do that. If the following looks a bit strange, I'm following the example of an MFC wizard generated app without document and view support (the document isn't needed). I'm using this approach to try and reduce the ties to frame/document/view and make this work. Tried it the standard way and it didn't go either.
{
CMDIFrameWnd* pFrame2 = new CCalendarFrame;
// create secondary MDI frame window
if (!pFrame2->LoadFrame(IDR_CALENDARTYPE)) return;
// create a new MDI child window
pFrame2->CreateNewChild(
RUNTIME_CLASS(CCalChildFrm), IDR_CALENDARTYPE, NULL, NULL);
// The main window has been initialized, so show and update it.
pFrame2->ShowWindow(SW_SHOWNORMAL);
pFrame2->UpdateWindow();
}
Thanks!
|
|
|
|