I have an IE instance embedded in my C application using COM. With IWebBrowser2.Navigate I can pass headers to be sent along with the request, except apparently "Accept-Language". It seems the language settings from IE itself always override the value I pass in for that header. Is there any way around this?
I don't think IE allows you to customize the settings so much. Never used it in C, but Delphi has a wrapper class to IWebBrowser2 (TWebBrowser), and most settings used by the component are global. I mean, the same for standard IE and embedded IE.
Maybe you can change it on Internet Options or even modify some registry keys, but be aware that it will also apply globally (embedded or not).
Have you tried callling SetThreadLocale? Maybe IE ignores the header in favor of the user's language settings.
Related
I want to host a website on Boomla where the user can enter program code and a client-side compiler compiles it. The compiler uses eval() internally, which I cannot work around, so I absolutely need it enabled.
The default Content-Security-Policy rules do not allow eval, and it is not allowed to enable it with .ContentSecurityPolicy either.
You can now use the Content-Security-Policy rule script-src 'unsafe-eval'.
Original answer: Correct, it's impossible right now. Let me get back within a day, I have already been considering to enable it on demand (make it configurable).
What does it mean that a function, in particular CryptExportPKCS8 is deprecated?
https://msdn.microsoft.com/en-us/library/windows/desktop/aa379932(v=vs.85).aspx
I'm aware that one can't use it with newer version of wincrypt just because it is not present in header file, but can a program based on old wincrypt.h and crypt32.lib still retrieve private key from certificate store in Windows 10? Or is it impossible to access such data without using more up-to-date API?
Deprecated means "going away, change your code". In this case, it appears that MS wants you to use PFXExportCertStoreEx() instead.
I am currently faced with a dilemma in regards to adding any kind of DLL to a ColdFusion project. I have done a ton of research but nothing seems to be simplistic enough to grasp an understanding. I have a Winform that uses the same DLL in the Reference which makes life easy. When looking to add the same DLLs to a ColdFusion project, it doesn't seem to be working. I have tried using the following:
<cfobject type="com" name="myObj" assembly="C:\DocViewer\AxInterop.SHDocVw.dll">
Here is the error message I am receiving as well:
Attribute validation error for tag CFOBJECT. It has an invalid
attribute combination: assembly,name,type.
This site has been very helpful in the past and I am hoping to learn how this DLL in CF9 works so that I do not have to completely rewrite an entire program when the current one works perfectly.
From comments
I tried adding the DLL using the regsvr32 but here is my error now:
the module was loaded but the entry-point dllregisterserver was not found
Well it looks to me like you're using the cfobject attributes for a .NET object instead of for a COM object. The cfobject tag is one of those tags where the attributes vary by action/type, like cfcontent, cffile and cfdirectory (and a bunch of others that don't immediately spring to mind).
So you need the documentation for accessing COM objects specifically, which for the latest version of Adobe's CFML engine is located here: https://wikidocs.adobe.com/wiki/display/coldfusionen/cfobject%3A+COM+object
There's a typo on the docs page, but it looks like this should work for you (although I'll admit it's been a while since I've invoked a COM object):
<cfobject
type = "com"
class = "path.to.com.Class"
name = "myObj"
action = "create|connect">
It looks like you would use action="connect" if you have it installed as a Windows Service, or create if you want CF to instantiate the DLL, but I would guess having it installed as a service would be easier. I'm just guessing, but I think "path.to.com.Class" would be the name of the service if you're using it that way, or it would be the logical path to the .dll file if the CF server is instantiating it. If neither of those options work, then there might either be a version incompatibility if this is being moved to a newer OS, or the service might be misconfigured.
The error message from registering the DLL sounds like (and I'm guessing because I've never created a windows service DLL) it's looking for a specific class or function in the DLL in order to register it as a service in Windows and it can't find that "entry point" in the DLL (i.e. in the same way that Java will look for a "public static void Main(String args)" as the entry-point to a Java program). That may be necessary for a Service, but it's probably not necessary for a generic DLL that might be accessed and used in some other way, so it's possible this DLL might work, but not be compatible with Service registration.
So going back to your sample code, this might work:
<cfobject type="com" name="myObj" action="create"
class="C:\DocViewer\AxInterop.SHDocVw.dll">
I built up a module that creates a window with an edit box from windows' EDIT windowclass. It is designed to only work with ansi character set and not using any unicode.
I make use of EM_GETHANDLE to recieve the buffer to the edit control.
Now here is my problem: (quoted from link above)
Note For Comctl32.dll version 6, the buffer always contains an array of WCHARs, regardless of whether an ANSI or Unicode function created the edit control. For more information on DLL versions, see Common Control Versions.
So when my module gets loaded by an application that has comctl32 initialized, my whole code breaks.
My Question: Is there a way to prevent CreateWindowA to use comclt32 or does anyone have an idea to fix this problem?
The application uses COMCTL32.DLL if it is specified in the app's manifest as described e.g. here: http://msdn.microsoft.com/en-us/library/windows/desktop/bb773175%28v=vs.85%29.aspx
If your module is DLL, then you might try use some isolation technique so it does not rely on what version of COMCTL32.DLL the .exe decided to use, but that might bring many other drawbacks.
I recommend to use WM_GETTEXTA or GetWindowTextA() instead, which will copy converted string into your buffer. Designing a module which requires old version of a DLL to work correctly is simply bad idea.
I'm implementing a RESTful web API in an embedded stack which provides a webserver without the REST feature. To be precise, the embedded stack is RTCS which runs on top of the MQX RT operating system, the microcontroller is a Kinetis K60 from Freescale. I'm able to distinguish GET/POST/DELETE/PUT requests and to get the url with the parameters (let's say /this/firstValue/that/secondValue/...).
I use strtok to separate the different elements of the url and take decisions. But my code is just ugly because it's full of strcmp functions and if statements. I also need to check bounds for firstValue and secondValue (which I could do in set/get functions, but 2 functions for each parameter will be repetitve). Moreover I'd like to be able to add parameters without messing around with the decision tree.
I have two questions:
How would you make the code nice and dry?
Do you think a REST webservice is appropriate to control my microcontroller over the network? Do you have examples of such things? I'm using a REST webservice because it provides authentication (no secrecy however because I can't setup SSL sockets yet) and I think it's an elegant solution.
I evaluated some other solutions:
SNMP (snmpset/snmpget): it worked but setting up the MIBs was a real pain, and since it's SNMPv2 there is still no secrecy.
telnet server (I have no SSH solution yet): I don't see any advantage/drawback aside that REST will probably be easier to control from the outside, I'm testing it with curl :)
SOAP Remote Procedure Call (I just don't like it)
Any other idea ? I need something simple and scalable since there could be multiple targets to control. I have limited resources :s. I would need secrecy at some point, and I expect to have it when CyaSSL (an embedded ssl implemetation) is ported to MQX. They said it's happening next month so secrecy won't be an issue anymore but if you have other ideas...
--
Emilien
REST is an architectual pattern, So i guess you mean your server provides HTTP.
A resource is 'any data that can be named'. e.g. an LED on your embedded device could be a URI of '/leds/led3' You could change the data it holds (its state, rgb led? etc) with the standard PUT request, and GET should return its current state.
As for coding it, a generic tree structure maybe wise if memory permits to make path finding as simple as possible. With the data and function pointers (emulating objects) at the leafs