visual-studio-2008

How can I locate all the network printers in the enterprise?

浪子不回头ぞ 提交于 2019-12-14 03:48:11
问题 When I go to Printers and Faxes dialog, I can click the Add a printer link, select Network Printer , then Find a printer in the directory . From there I get a dialog box which lets me find ALL printers in the enterprise. I need to find all the network printers with my code. How can I do this? Note that I am not talking about network printers that are connected to my PC, but all network printers in the enterprise (my workplace has almost 4000 printers). P.S. PrintServer().GetPrintQueues only

Irregular file writing performance in c++

柔情痞子 提交于 2019-12-14 03:46:23
问题 I am writing an app which receives a binary data stream wtih a simple function call like put(DataBLock, dateTime); where each data package is 4 MB I have to write these datablocks to seperate files for future use with some additional data like id, insertion time, tag etc... So I both tried these two methods: first with FILE : data.id = seedFileId; seedFileId++; std::string fileName = getFileName(data.id); char *fNameArray = (char*)fileName.c_str(); FILE* pFile; pFile = fopen(fNameArray,"wb");

How do I get the duration of a video file using C#? [closed]

时光毁灭记忆、已成空白 提交于 2019-12-14 03:15:17
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed last year . Any library in C# that allows me to do that? 回答1: google result for http://johndyer.name/post/2005/07/22/Retreiving-the-duration-of-a-WMV-in-C.aspx using WMPLib; // this file is called Interop.WMPLib.dll WindowsMediaPlayerClass wmp = new WindowsMediaPlayerClass(); IWMPMedia

ORA-01000: maximum open cursors exceeded in asp.net

♀尐吖头ヾ 提交于 2019-12-14 03:12:54
问题 I'm facing ORA-01000: maximum open cursors exceeded After hosting an ASP web page on IIS. When I test the web page with visual studio. The maximum open cursors exceeded problem does not happen. What the cause of the problem happen & how can I solve it When I close and displose the Oracle connection then will the opened cursors be automatically closed? If not, how can I close them? Code I use to close & displose the connection rdr.Close() rdr.Dispose() cmd.Connection.Close() cmd.Connection

How to use AddFontResource in c# for Windows CE 5.0 application with .NET 2.0

家住魔仙堡 提交于 2019-12-14 03:04:42
问题 I'm trying to develop a Smart Device program for Windows CE 5.0 device in my car with Visual Stdio 2008 pro and c# with .NET 2.0. I want to add a font using AddFontResourceEx, but I can't get it to work. Here is the code: public partial class Form1 : Form { public Form1() { InitializeComponent(); } private const uint FR_PRIVATE=0x10; [DllImport("GDI32.dll",EntryPoint="AddFontResourceEx")] static extern int AddFontResourceEx(string lpszFilename, uint fl, IntPtr pdv); private void button1_Click

strange level of indirection of a function call

被刻印的时光 ゝ 提交于 2019-12-14 01:55:12
问题 I'm writing some low level code and I noticed some unnecessary level of indirection of a function call and I simply don't get what's the reason for that indirection. Here's dummy code that reveals that behavior: __declspec(noinline) int get_alignment(void * ptr) { return 1; } __declspec(noinline) int test123() { char buf[123]; return get_alignment(buf); } Then, when I step through the code inside function test() in debugger in asm mode (Ctrl+F11) I see this: __declspec(noinline) int test123()

is it possible to get Visual studio to index source code to improve string search?

心不动则不痛 提交于 2019-12-14 01:04:16
问题 I often use the string search feature for an entire solution in VS2008. Is there a way to improve its search speed by getting VS2008 to index all the source code and config files, similar to how Google Desktop index files? 回答1: Though I don't think it is possible to do within visual studio you may want to use WinGrep, or another grep tool to do this sort of search instead. 回答2: This adds instant full text search of all files in a VS solution. Not free but cheap and is well worth the money. 30

Invalid Operation Exception from C# Process Class

ぃ、小莉子 提交于 2019-12-14 00:16:25
问题 When I use VSTS debugger to see the properties of instance of class Process , many of the properties are marked with InvalidOperationException . Why? Am I doing anything wrong? I am using VSTS 2008 + C# + .Net 2.0 to develop a console application. Here is my code: System.Diagnostics.Process myProcess = new System.Diagnostics.Process(); myProcess.StartInfo.FileName = "IExplore.exe"; myProcess.StartInfo.Arguments = @"www.google.com"; myProcess.StartInfo.Verb = "runas"; myProcess.Start(); And a

How can I see my applications threads while debugging in Visual Studio?

烈酒焚心 提交于 2019-12-14 00:14:56
问题 I would like to see the threads currently active in my application while debugging it. How can I do this using Visual Studio? 回答1: Yes, go to Debug->Windows->Threads 回答2: Debug | Windows | Threads or Ctrl-Alt-H 回答3: While RichS' answer is technically correct, the information displayed in that window is not as helpful if you have a number of thread in wait states or sleeping. I would recommend you make sure you name your threads for better visibility in the Thread window. Use the Thread.Name

Using OpenGL on Windows Form Application in Visual C++

拥有回忆 提交于 2019-12-13 22:36:31
问题 I want to draw 3D graphics on Windows Form Application in Visual C++.How can I adjust OpenGL library on Visual Studio 2008? Could you advise me any tutorial that mention using OpenGl Library with Windows Form Application and Visual C++? 回答1: Here's a tutorial on embedding OpenGL in a form application (the full source code for the demo project is also included) 来源: https://stackoverflow.com/questions/1187115/using-opengl-on-windows-form-application-in-visual-c