View DWG files in a browser - c#

I have an application developed with Asp.Net and C#. I have to display DWG - CAD files(stored in a server) in a client side browser. I cannot install Auto CAD or any other software or activeX control in my client side machines and it can be installed only on the server. Is there a way to achieve it?
I have tried the DWGViewX, but it was not able to display the image when accessed from a client. But when accessed from the server itself, am able to view the DWG file. I have just tried the trial version of DWGViewX. Is this issue because of the licensing issue?
ANy help in this regard will be greatly apprecited.
Regards
Vignesh

Have a look at CadLib. It has an ASP.NET example solution in the evaluation download. There's also a beta version for a Silverlight 4 edition (see the forum).

First, download the free DWG TrueView from Adobe and install it.
After that open Visual Studio (I use 2008) and open a new Windows Form Project.
Then switch to the form-designer.
There you open the toolbox and add a new tab "TrueView" or so.
After that rightclick and "Choose Items..."
--> wait a couple of seconds
--> then choose the tab "COM Components"
--> there you should find "Autodesk AcCtrl" mark it.
Now you have a component "Autodesk AcCtrl" in your "TrueView" Toolbox --> use it on the form.
and now, very simple, you need only one line of code in the Form1_Load function (generated through Visual Source) and put the following code in it:
axAcCtrl1.PutSourcePath(#"C:\WHERE\EVER\YOUR\DWG\FILE\IS\example.dwg");
Thats all!
Hope it helped!

If you want your end users, without having autocad or any compatable viewer for dwg files, then you need to convert dwg drawings to pdf or jpg. There are some libraries available in web to accomplish that. See the below url:
http://www.codeproject.com/Questions/103830/convert-from-dwg-to-pdf

Related

Uploading code to another TFS instance (VSTS)

The other day I wanted to upload code on my laptop to my Visual Studio Team Services account. The problem was that the code had been developed on a different TFS instance.
I found no way to connect to VSTS, with an already existing solution and just upload it, check it in. Instead VSTS required me to create the solution there. Barring any major file copying I could not find a simple way to do this.
There's one other question similar to this on S.O. but it requires 3rd party intervention. Shouldn't this be a simple matter?
Please advise.
Remove the binding to the old TFS first, in VS2013(and 2010) it is here: File -> Source Control -> Advanced -> "Change Source Control...". Select each project in the list and click "Unbind" for each of them.
After that there shouldn't be a problem.

New Blank Page(XAML) projects = Controls are not showing on the MainPage(only their borders are)

I'm new to Visual Studio and couldn't find my answer anywhere else for hours over the internet..
I'm Using "Visual Studio Express 2012 for Windows" and everytime I create a new project with a blank page (XAML), the designer only shows me the frame of the page with its missing background.
And any control I drag to it, is invisible (I can only see the square border of the control I dragged but no texture..)
This is only happening during design time. On RunTime it actually shows up..
This is happening to me since I had the first fresh install. Just to be clear, I am NOT opening an existing previous project.. I have non. This is the first time I make a project in C# and I'm surprised I didn't find anything useful so far over internet search..
Also tried installing, uninstalling, repairing and changing to different versions...
The problem didn't show on Visual Studio 2012 Express for Desktop, but this product doesn't seem to be fit to my needs.. (I'm trying to also learn how to develop for Windows Store and other products)
The IDE doesn't show any errors or warnings..
Help would be much appreciated!
P.S - I'm running Windows 8.1
You can try Blend to open the project and render the xaml,if the problem appear too, maybe you should check out your graphics card or update driver.
try with this!
Check the following:
Tools -> Options
Expand Text Editor -> XAML -> Miscellaneous
Make sure that "Always open documents in full XAML view" is not checked
Or perhaps the default program for opening .xaml files has changed:
Right-click your .xaml file in Solution Explorer
Click Open With...
Select XAML UI Designer
Click Set as Default button
Click OK
If it's related to the video driver, maybe disabling hardware acceleration will help?
Or you could try Visual Studio Community Edition (http://www.visualstudio.com/, click on the Download button under "Free developer tools"
Did one of these suggestions work?

RDLC Report not displaying in IE 11

I am using report viewer control for reports. Now we are facing the problem in IE 11, Report not displaying in IE 11. Its showing only loading icon all time.
You are probably usign ReportViewer version 10 or below. Probably it craches in Chrome and Firefox too.
I don't know why by in this case if you inspect the network traffic in you prefered dev tools in the browser you will see that it try to download an image that is missing and it break the code.
To sove this problem you need to update your ReportViewer dlls to the version 11 (2012) at least and take into account some problems it can bring. They are these:
Microsoft.ReportViewer.Common.dll
Microsoft.ReportViewer.ProcessingObjectModel.dll
Microsoft.ReportViewer.WebForms.dll
Is possible that after the update you will need to reference Microsoft.SqlServer.Types.dll too.
You will need to change your .config file too, basically changing the version number to 11.
To be clear, I didn't update it on the server but changed these dll to Copy To Local in Visual Studio so they are published togheter in the bin folder.
Please get in touch if you need further help. I lost a lot of time searching for this but can't remember all steps I did to solve.

Using VLC Activex Plugin in WinForms

I am trying to use AxVLCPlugin1/AxVLCPlugin2 in my WinForm. After some research, I've downloaded VideoLan 2.00, registered the axvlc.dll in my system, copied the plugins as well as dll's into project's output folder and added the control to my WinForm. If I try to run the code, I get:
"Unable to get the window handle for the 'AxVLCPlugin2' control.
Windowless ActiveX controls are not supported."
The environment is under Windows 7 32bit, Visual Studio 2008 and its all running on .NET 3.5.
I've read that the problem might be due to VLC library not supporting the newer Windows 7, but that shouldn't be a problem with VLC 2+ versions. I have also tried older/newer versions of VLC but still no luck.
My sample code to start the video (using 2nd plugin):
this.vlcMediaPlayer.Volume = 50;
this.vlcMediaPlayer.playlist.add(#"file:///C:\Users\Public\Videos\Sample Videos\Wildlife.wmv", "wildlife", " ");
this.vlcMediaPlayer.playlist.play();
The problem can be related to security feature of Windows called DEP (Data Execution Prevention), see link.
You can control its setting from here:
This explains the problem fairly well, see link.
It is not necessary to copy dll files to your project dir. Simply add reference to AXVLC and AxAXVLC. Search for a video instruction on Youtube.

How can I get printers icons in c#

Can anybody tell me how can i get the icon of PrintQueue object (like in explorer) in C#.
I get the list of all printers with this code :
LocalPrintServer PrintServer = new LocalPrintServer();
PrintQueueCollection PrintQueuesOnLocalServer = PrintServer.GetPrintQueues(new[] { EnumeratedPrintQueueTypes.Local, EnumeratedPrintQueueTypes.Connections });
Thanks in advance
NeoKript
If you want an operating system icon you should try open shell32.dll ( or try with other dll in system ) as a resource file with Visual Studio, you should find the icons there, but I don't know if you can use in your application.
Here a screenshot on opening a dll as a resources:
and here what you obtain:
Of course you have to try open the icon one by one to look for the one you need, maybe you want the one called 17 ?
Here you go: http://msdn.microsoft.com/en-us/library/ms247035.aspx
(Visual Studio Image Library collection of icons freely usable in your app).
'The Visual Studio 2010 Image Library contains application images that appear in Microsoft Windows, the Office system, Microsoft Visual Studio, and other Microsoft software. You can use this set of over 1,000 images to create applications that look visually consistent with Microsoft software'.
Most of the system icons are embedded resources in the system dll files.
Try looking in shell32.dll.
You can use the list here to find the icons that you want to use.

Categories