Our product consists in DLLs we ship to our customers.
When providing Windows 8 versions, I noticed I couldn't link against the CRT statically otherwise applications using our DLLs don't pass the certification.
I couldn't find any document that mentions that. Does someone know why it's not possible or how to make it happen?
Our product only makes use of malloc/free and math functions. It would be so much simpler to link against CRT statically instead of requiring every application that links against us to install the proper vc redist. (and ffs why aren't vc redists deployed through the Windows Update channel?)
Windows Store apps can only be built using VS 2012 and the current CRT. The key point is that static linking of the CRT is not supported for Windows Store apps.
Here is some more information about the CRT:
Windows Store Apps, the Windows Runtime, and the C Run-Time
http://msdn.microsoft.com/en-us/library/hh972425.aspx
Here are the list of UNSUPPORTED crt routines:
http://msdn.microsoft.com/en-us/library/hh674596.aspx
Rob Caplan writes here:
http://social.msdn.microsoft.com/Forums/en-US/winappswithnativecode/thread/0fa0695f-9828-46ac-985b-5ca15f3bee0a
"If your lib links to a Metro style app compliant C runtime you will be able to call standard C functions such as fopen. You can test against the App Cert Kit to confirm. Runtimes older than VC 2012 's will not work.
Your app will still be subject to the security sandbox and won't have access directories outside of its app data and package."
Related
I have a 3rd party legacy app that requires a VB6 Active X EXE library interface. I am looking to update the VB6 Active X EXE library to a currently supported language. As the legacy host application is from a 3rd party I do not have the ability to change the host API to use an interface other than ActiveX EXE. Is there any currently supported Microsoft language i.e., x86 C++, C++/CLI, C# or VB.NET that can create the equivalent of an ActiveX EXE interface?
I suspect the answer is no but am looking for a definitive response saying so. That any legacy host application using ActiveX EXE library must be itself be modified to allow the use of supported languages and tools. Basically confirming that effectively ActiveX EXE is now an unsupported API interface.
I've already looked at this similar question and from it one could deduce that the answer is no but there is no definitive response. I've also looked at this Microsoft Tutorial and from what I can tell it talks about updating the host application which isn't an option in this case. The tutorial talks about switching to an ActiveX DLL but my understanding is that this would require a change to the 3rd party host application. Again that is not an option in my case. I need something that looks like an ActiveX EXE library to the host.
If you are sure that an ActiveX Exe is required, have you considered just using VB6 to create the that as a thin shim and then have it delegate all implementation to a .NET assembly? You probably would never need to recompile the Exe again, unless the 3rd party vendor is still expanding their interface.
If you post some more information about the VB6 Active X EXE library interface, I might be able to refine this solution with specific code samples. Presumably your Active X Exe must implement a provided interface?
I have a "proof of concept" piece of work that crosses over into some unfamiliar territory. I have some experience on J2EE technologies. I'm tasked with connecting an EFTPOS machine to an web application. I am planning to use applet to interact with dll. dll will be running on the client side.
I need to interact with one dll from web application. Please provide me any guidance on this, as I am new to it. I tried interacting with dll from standalone java program, but not able to connect from web application. Any sample codes will be very helpful for me.
Yes that is perfectly possible with an applet. I "connected" an electronice signing device before and it was working very well. Depening on what kind of .dll we are talking about here you need to do the following things:
1.) Create a java access layer / interface for your dll, so that you are able to call the dll functions from java. Depending what kind of dll we are talking about there are several possibilities. The base technology is JNI which is however quite cumbersome to use but luckily there are much more convienient ways out there:
use JNA (if it is a C dll)
use Jacob (if it is a COM component)
use bridj (if it is a c++ dll. You may try swig but haven't used that, so can't tell)
2.) Put your dll inside a jar file and distribute it alongside your applet. How this works is quite nicely described in the jacob project which provides an example for that. You can find it in the source package under jacob-1.17_src.zip\jacob-1.17\samples\com\jacob\samples\applet The example describes the JNLP way to access a native library which will work above java version 1.6.0_10. If you have to use a lower version for some reason, it is also possible but is slightly more tricky...
3.) One more side note: Since the latest available java version (1.7.0_51 or 1.6.0_71) due to security, some rules have been added or tightened for java applets. Now you have to sign your applet with an official certificate and set the right attributes/properties in the manifest, jnlp files. But this has been discussed in great detail here so just search for it. I would probably use a slightly older version for development and if that is working, figuring out how to make it work in the latest java version...
4.) Regarding the interaction part there are also several possibilities. Your Java Applet can call jscript methods from the website it is running in (or also the other way around) or the applet directly communicates with your server. You have all possibilities on that front...
I have a few questions on Windows CE.
1.Does Windows CE supports use of ActiveX objects in HTML page?
2.Can ActiveX controls be developed/written in .Net C# with Visual Studio 2008 for use on Windows CE 5.0 IE Browser?
3.Is it necessary to install .NET CF in handheld device?
The requirement is to get local information about the device(IP, hostname, etc.) from the html page. I am currently doing R&D to find out how to achieve this. What we thought of doing is to call a custom ActiveX dll from html file which will run locally on the hand held device to get the required information and pass it to the html page.
If anyone knows of other ways to achieve this then please share.
Thanks
Yes, the CE browser supports COM objects that implement IObjectSafety.
No. The controls must be written in C++. To make it even more fun, they must be compiled for the device OS and processor architecture. The reason you can't create them in .NET is because the Compact Framework doesn't support EE hosting, so native code cannot call managed code on a device (inside our outside a browser).
This is orthogonal since the answer to #2 is no.
There may be another way to achieve your goal, but it's not clear what the actual problem is to me. You have a page served up from the device that needs to show the IP address to a browser on the same device? How does that user get to that page? If it's from an app, you could have the app either report it directly or have the app get the IP and save it into an HTML page which you then browse to.
EDIT
Based on your comments, if your customer won't allow the install of the CF, then they likely aren't going to want you to install an ActiveX component either (and if you could do .NET components, it would have required the CF be installed, so your requirements would have precluded doing so even if it were supported).
Why not write a simple C program that does what your CF program does (i.e. saving device info to an HTML file) and that requires no additional framework installs?
If your HTML is being served from a webserver, then it already knows the IP address that it is talking to (i.e. there might be some proxies in the way, but if they're behaving, they can tell you who the remote client really is), so you might not need to install anything.
As for the version of Internet Explorer installed on CE 5, I don't believe it supports ActiveX at all, but you could install a .Net application instead of using a webpage to solicit information?
Is it possible to use private APIs in Windows Phone 8 development similar to iOS development?
Of course, this is NOT about apps going to get published (AppStore/Marketplace). But there are a lot of use cases for non-public projects where a developer wants to call internal system functions.
With the Windows Phone 8 SDK installed, one can mount the Windows Phone 8 Emulator image located in C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Emulation\Images. In the main partition of the Windows Phone OS, one can navigate to Windows\System32 and inspect the system DLL files with a tool like Dependency Walker or IDA Pro.
There are a lot of functions that sound very interesting but which are not publicly available and thus not documented. The question is: is it possible to call them somehow from an app or by other means?
Just a few examples of interesting functions (there are much more):
ShellChrome.dll: InvokeStartMenu, InvokeScreenCapture, InvokeVolumeUp, LockDevice, ...
InputInjection.dll: ApiInjectInitialize, ApiInjectTouchEvent, ...
...
I tried to get LoadLibrary (specifically, LoadLibraryExA) working somehow in a native Windows Phone App project, and to load and call these functions (the loading of the library worked). Long story short, I ended up with access violation errors or similar when trying to call the functions (maybe because of the sandboxed execution environment). Another problem is, that I can only guess the signatures (arguments) of the functions. I can't find them out with the tools I use.
Private api? We can use dll files in the windows phone. I have used private sdk's in the windows phone. I don't think windows is going to permit us to customize the OS just like Android do, So Invoke volume up..etc stuff is not going to work through private api.
I think they only provide some private apis to only partners with an NDA.
http://social.msdn.microsoft.com/forums/wpapps/en-US/4af0e87a-ab4b-4652-891a-f198a32758cf/windows-phone-8-access-to-private-apis
You can't, the application sandbox will enforce API usage. That means you will get an UnauthorizedAccessException every time you try to do a call to an api requiring rights you don't have.
This is intimately tied with the developer account you use to unlock your phone for development purposes.
EDIT : That's also true on the c++ native side.
There was a challenging situation happened when i was working with install to provide product key validation. I had to use C++ unmanaged code to validate the key. Actually we had the main validation logic written in C# and I had to create a mixed project. Problem was not stopped only with these, it continued. Since I used VC++ code, it expected atleast the VC++ runtime redistributable to be installed in the client machine. I thought of dropping the plan to migrate our install to Wix because of these kind of problems.
But I came to know that there is a nice and very cool feature that DTF is available in Wix to integrate any kind of actions in C#. I used it and could integrate the key validation in couple of hours and till now it is working fine in all client machine I implemented before 6 month.
Do you have any interesting moment or nice experience with DTF?
Search my blog at http://blog.deploymentengineering.com for DTF and you'll find a lot of useful content. I love DTF but I still believe that the best solution is to avoid a CA whenever possible in the first place. C#, like VBScript before it, is so luring that it tends to suck imperative thinking developers into writing CAs when not needed. I believe this is the reason DTF wasn't released for so long.
At my day job my approval is required for anyone who believes they need a CA. I instruct the developers on basic MSI philosphy, how to use DTF, how to attach a debugger and I make it clear that they are on the hook if it ever has any issues. The result is very few but well written CAs in our product line.
I have written several .NET CAs to support our WiX based installs:
Managed Wrapper around HTTPAPI.DLL - supports creating IP/Port SSL bindings and HTTP Url ACLs for use in deploying WCF services. I plan to turn this one into a Wix Extension. It was very interesting learning how to properly handle rollbacks, etc.
SSL Picker dialog that displays all the SSL certificates on the system and allows you to pick one.
SQL Server browser dialog - lets you browse your network for SQL Servers and then browse SQL Servers for Databases. Optionally uses impersonation. This is for crafting a connection string.
I am in the process of writing a set of CAs that will use the Microsoft.Web.Administration assembly to do native installs of web applications on IIS 7 (without requiring the IIS 6 Metabase Compatibilty feature be installed).
First off, the C#/DTF custom actions are still custom actions (no magic here :-)), so you should follow all the various CA guidelines working with this kind as well. It simplifies most of MSI tasks by abstracting low-level API behind the high level well-designed classes. Also, keep in mind that you can use managed code CA only in case the target machine has .NET installed (or install it as a prerequisite). Finally, the dtf.chm documentation which is distributed along with WiX toolset has some simple, but self-explanatory examples.
Hope this helps.