Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

c# dllimport of MsiGetShortcutTarget(msi.dll) failed with error 1603 under Windows 7 -


i want resolve advertised msi shortcut in c# described here: how parse "special" .lnk files, aka. msi shortcuts aka. windows installer advertised shortcuts using c#

[dllimport("msi.dll", charset = charset.auto)] private static extern uint32 msigetshortcuttarget(     string szshortcuttarget,     [out] stringbuilder szproductcode,     [out] stringbuilder szfeatureid,     [out] stringbuilder szcomponentcode);  public static string parseshortcut(string file) {     stringbuilder product = new stringbuilder(maxguidlength + 1);     stringbuilder feature = new stringbuilder(maxfeaturelength + 1);     stringbuilder component = new stringbuilder(maxguidlength + 1);      uint32 res = msigetshortcuttarget(file, product, feature, component);     ... } 

i use vs 2010 , tried different settings "platform target" and/or "target framework". msigetshortcuttarget returns 1603 (a fatal error occurred during installation) under windows 7.

i tried same c++ , can resolve shortcut , fine. tested msi.dll, copied windows xp , dll can resolve shortcut c# code. have no idea why c# code won't work msi.dll under windows 7.

i testet msigetcomponentpath known product guid , component guid resolve target path in c# dll, returns 1603 msigetshortcuttarget , works perfectly. msigetcomponentpath fails under windows 7 , don't know why went wrong.

this seems related way com initialized.

if add [stathread] main method, works fine (well, if use stringbuilder instead of char[] arguments :-), return value of 1603 when using mta.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -