How do I combine the controls from 2 or more C++ MFC OCXs into 1 OCX? - html

It has been decreed that we will merged several (C++) OCXs, all of which use MFC as a static library, into 1 OCX, to save the download overhead of multiple copies of C runtime. Management is afraid that the shared DLL setting may cause an installation problem on some version of windows. I am unwilling to play "you bet your job" that they are wrong.
I have merged 2, by turning 1 into a static library and linking it into the other and adding the linked type library as a resource. I am attempting to load the linked control into an ASPX , by its guid. IE finds the merged OCX (because I modified the registry). The combined OCX loads, but the linked control does not.
To FORCE it to load, I manually create a new instance in the OCX "application" code.
Now, it won't receive commands from IE or send events. Creating the linked control's frame fails, but the LastError is 0.
I've tried other approaches to merge the controls; this is the first one to build and register.
How do I combine the controls from 2 or more OCXen into 1?
How can I get some diagnostic information about my linked control's failure to create its frame?
What am I missing?

Related

Associated dimension of a detail disappears after reload / save

In BusinessObjects webi, I want to merge two variables, one from the universe, one from an excel file.
Query CC data (universe): Site
Query Site mapping table (excel file): Phenix Mapping Key (Entity Name)
If I merge the two dimensions in the report, it works.
However, if I merge the two dimensions using intermediate variables, the "associated dimension" of the detail got lost when saving, closing and reopening the document (or when refreshing it).
When creating the variable, it works, the values in the table appears:
However, after saving, closing and reopening, the "associated dimension" disappears and there is a #datasync error in the table (which is normal with no associated dimension):
Is it a problem in my code? SAP bug?
Version of SAP: SAP BusinessObjects BI Platform 4.2 Support Pack 3 Patch 2
Version of webi: 14.2.3.2220

PhpStorm: how to apply external tool (jpegoptim) on many files?

I am using jpegoptim in PhpStorm as external tool.
Works fine when I do select 1 file.
How can I apply that on many JPEG files ?
That's not possible at the moment (not supported).
https://youtrack.jetbrains.com/issue/IDEA-90239
https://youtrack.jetbrains.com/issue/IDEA-97869
Watch these tickets (star/vote/comment) to get notified on any progress.
If you definitely need it in one go (and not calling that External Tools entry once for each file)... then what you may try is:
Select desired files
Use Copy Paths from context menu
Call another External Tools entry that:
Uses $ClipboardContent$ macro
It's some shell/batch script that parses such parameter (splits into separate lines to get individual paths) and then calls actual program in cycle -- once for each file from the parsed parameter.
A bit too complicated as for my liking... Plus, I've not tried it myself so not sure how line ending symbols will be passed here (so it can be parsed in the script).
BTW -- you can assign custom shortcut to particular External Tools entry so you may call it for each file individually -- it will be faster with shortcut than doing the same with the mouse.

Access VBA: Update Reference Library with AutoExec macro, work's in accdb format but not when compiled?

Here is my VBA code to be executed in MS Access 2010. For simplicity I've removed error handling in this code. Function resides in a module with a different name.
Public Function ReAddLibrary()
Dim accessProj As Access.Application
Dim chkRef As Access.Reference '
Set accessProj = Access.Application
' Check through the selected references.
For Each chkRef In accessProj.References
' If the reference "MyReference" exists then remove.
If chkRef.Name = "MyReference" Then
accessProj.References.Remove chkRef
Exit For
End If
Next
‘ Add back the reference “MyReference” from specified location.
accessProj.References.AddFromFile "Access Database Path"
End Function
Adapted from
https://msdn.microsoft.com/en-us/library/aa221567(v=office.11).aspx
Premise
Users, use Access databases as the front end, naturally there’s an array of them. One thing in common is that they share reference to an accde database which houses shared functions. Naturally these databases are compiled to stop users getting at the VBA/Design mode. The database that is being referenced is also compiled. Currently work is being done to its accdb equivalent and every time it is published as an accde to the database location, an unresolved reference is created. The reference path hasn’t changed location (Nor will it). All recipient Accdb databases work fine, but their equivalent compiled versions throw a generic error when a button linked-subroutine is clicked for example.
If I use the above code as a subroutine linked to an on click event such as “On Load” for a form housing a button in question, this code works perfectly, even compiled. But if I convert this to a function and link it to a macro named “AutoExec,” it will execute the macro when opening the database but will.
Work in a non-compiled database
Will not work when database is compiled
The AutoExec macro route is because I just want this code pasted in once and executed once when the user opens the database, so the reference is recreated and not broken.
Macro
Action: RunCode
Function Name: ReAddLibrary ()
My thoughts
Initially, I’ve looked into late binding as a solution but I’m finding it hard to grasp as I don’t really code in VBA, I primarily code in sql and thus miss Intellisense and syntax highlighting. All examples are for excel workbooks making it difficult to relate. All my users and myself use the same Access 2010 so there is no version confliction. So I don’t know if this is the answer.
http://www.granite.ab.ca/access/latebinding.htm
I considered running a script to recompile all the user’s databases. But, work to the referenced database is incrementally on going and booting people off would be a nuisance.
Why, when the compiled version still retains the correct accde file
path does it not work, when simply the referenced database has been
recompiled again?
Is it programmatically possible to drop a reference (If it exists)
and add a reference, when a compiled version of Access boots up, such
as linking it to a macro named AutoExec?
Is there an alternative way to run the above code without having to
add it to an ‘Event’ for all form objects? Saving me time as I can
centralize the code in one place.
Any Ideas?
The simple and sad answer is that whenever your code and/or a reference is changed, the project has to be compiled.
So, when done, you have to distribute both the project accde file and its external files (those that are updated, in practice all) to the users.

I am getting a C++ runtime error while running access vba module. Consistently reproducible

I have taken 2 sample databases from online - one for a calendar and one for drag and drop functions - and pulled some code together for a result that is ALMOST functioning as I had hoped.
There is a function to build/refresh the calendar, which works perfectly.
The drag and drop functions work perfectly. (The item is updated in the table to reflect the new date.)
When I drag and drop, the calendar doesn't automatically refresh. If I click next month then last month (which call the refresh function with a new date), the changes are reflected as expected.
The problem is when I try to automatically call the refresh function after a drag/drop event. Access crashes every time I call for a refresh in the code after drag/drop, regardless of where I put the call.
The error says:
Microsoft visual C++ Runtime Library
Runtime Error!
Program: C:...
This application has requested the Runtime to terminate it in an
unusual way. Please contact the application's support team for more
information.
I have tried:
I thought it might be trying to refresh too fast, so I added a pause
function and had the program wait 10 seconds after dropping before
refreshing. Still crashed.
I did a compact and repair on the database.
I ran /decompile from the command-line on my accdb file.
I exported the relevant form, tables, query and module to a new accdb
file.
I have tried to re-register the libraries checked under references.
(RegSvr32 "Path to library file") The only one that succeeded was
vbe7.dll. The "MS access 14.0 object library", "OLE automation", and
"MS Office 14.0 Access Database Engine Object" don't contain a
DllRegisterServer method, so regsvr32 did not succeed with those. There are no other
references checked. Still crashes.
I have tried countless places to insert the call to refreshcalendar()
I have stepped through the code and verified the exact place that the
crash happens. It is commented in the code.
Here is a link to the database.
To reproduce the problem:
Open frmsubCalendar.
There are 2 entries in May 2014 that can be dropped to other days on the calendar. I can then click the prev/next month buttons on the form, and when May reloads, the change has been made. But if I go into mod_drag_drop under the sub dropdetect() and uncomment the lines noted in the comments, the refresh will crash access at the end of the dropdetect() sub.
I cannot figure out how to make the calendar refresh automatically after a drag/drop event without access crapping the bed.
I realize this is a bit outdated, but I had a similar issue and didn't see this one being answered, I figured I'd add this answer for posterity. :) I discovered it was caused by a reference to a function by the form name. I had the following call in a module:
lContractCt = Form_Census.lContractCt_f(bIsMembers)
Where lContract is a Long, there is a form named Census and a public function in that form called lContractCt_f.
I moved the function to a module (so the Form_Census reference wasn't necessary any more). And changed the call to:
lContractCt = lContractCt_f(bIsMembers)
This fixed the error. So, I would check if you have any public function references going from a module to a form and move those public functions into a module. I also saw a similar thread with a different form reference, via Forms![Census], for example.

Is there a way to embed a compile-time dynamic timestamp in a Flash AS3 movie?

Background: I manually update a version timestamp in my Flash document, which is displayed on the log-in screen of the application at run time. This helps me verify that I have the latest version loaded in the browser, rather than some cached version.
The declaration for the variable is:
public static var version:String = "v 2012.11.14.1854"; //yyyy.mm.dd.hhmm
Is there a way to have this value automatically updated to the current system time when the document is compiled in the flash IDE? Perhaps with some kind of "compile time variable".
a) You can create ANT task to build, and there you can set variables, but its a rather complicated solution if you're developing alone and not using SVN or Perforce.
b) I'm not sure if it'll work, but use additional compiler arguments (project properties > Actionscript Compiler)
-date text
this sets metadata in the resulting SWF file. I'm not sure, how you can access it, I haven't tested it.