|
You can't copy anything to the C drive unless it's to the application data folder.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Its all because of UAC, google to run application as Administrator, vista will ask for the permission.
Actually, you are supposed to use the personal folder(My documents/App folder), in that case you will not face such problem.
|
|
|
|
|
I said that, but in a lot fewer words.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Hi all,
I have created a user control.
Now i am adding that user control in other application.
I added the reference of the dll, but i can't see the user control in my toolbox.
Am i missing something?
Thanks,
Nagendra.
|
|
|
|
|
Message Closed
modified 23-Nov-14 7:14am.
|
|
|
|
|
User Control is not visible in the Choose ToolBox Items Menu.
|
|
|
|
|
I got it worked.
|
|
|
|
|
Hi
If i covert any .Net component as COM component using tlbimp.exe then to use that library do i need .Net framework in the target environment?
|
|
|
|
|
satsumatable wrote: tlbimp.exe
I guess you mean tlbexp.exe.
There are only 10 types of people in this world — those who understand binary, and those who don't. |
modified on Thursday, December 31, 2009 2:01 AM
|
|
|
|
|
You are right .. I'm Sorry for the typo.
|
|
|
|
|
Go though this awesome article. Does not answer your question but is a good read for com interop.
There are only 10 types of people in this world — those who understand binary, and those who don't. |
modified on Thursday, December 31, 2009 3:53 AM
|
|
|
|
|
Hi, when uploading a image to a server, I get error saying directory not found. I am guessing its because its trying to find a path of users computer path in server and failing. in my localhost this works fine. how can i modify below code so that below line
System.Drawing.Image.FromFile(System.IO.Path.GetFullPath(flUpload.PostedFile.FileName))
maps to server. is there anyway i can get it working before actually uploading the original image to the server? thank you
using (System.Drawing.Image Img = System.Drawing.Image.FromFile(System.IO.Path.GetFullPath(flUpload.PostedFile.FileName)))
{
Size ThumbNailSize = NewImageSize(Img.Height, Img.Width, 100);
Size ImageSize = NewImageSize(Img.Height, Img.Width, 500);
using (System.Drawing.Image ImgThnail = new Bitmap(Img, ThumbNailSize.Width, ThumbNailSize.Height))
{
ImgThnail.Save(ImageThumbPath, Img.RawFormat);
ImgThnail.Dispose();
}
using (System.Drawing.Image Img1 = new Bitmap(Img, ImageSize.Width, ImageSize.Height))
{
Img1.Save(ImagePath, Img.RawFormat);
Img1.Dispose();
}
Img.Dispose();
}
|
|
|
|
|
Check this link : http://forums.asp.net/t/1079883.aspx[^]
Note: Please post the questions related to asp.net in the correct forum.
"Never put off until run time what you can do at compile time."
- David Gries, in "Compiler Construction for Digital Computers", circa 1969.
|
|
|
|
|
Is code specifically for Windows 7 (through the win7 SDK) ignored if executed on a pre-windows 7 OS? or do you have to do OS version checks before calling any of it? or will it just not run at all?
|
|
|
|
|
You don't have to do anything unless you start using functions that are specific to Windows 7. The Windows SDK is cumulative, meaning that each revision builds on the last one to add support for features in the new O/S. It does NOT mean that the SDK is specific to that version of Windows.
If you're going to use functions that only work on Windows 7, then you've going to have to include code that checks to see if it is running on Windows 7 before it uses those functions.
|
|
|
|
|
Hi im pretty new to programming so any help would be greatly appreciated.
I am trying to create an application that has the following features:
contains two texboxes labeled Formula Name: and Formula Number:
Contains a spreadsheet with 2 columns
Selections from a List Box
Able to total the quantity of the elements in the formula
Being able to print what is typed into the form Spreadsheet, Formula Name, Formula Number
Create a save feature
create an open feature
create a sort A-Z feature
I know how to put the objects in the form but I need help with coding. Any help would be greatly appreciated.
Sincerely,
Steven
|
|
|
|
|
Take help from a C# book (or do a google search) to start writing some code. When you run into any trouble paste your code here and people may be able to guide you.
There are only 10 types of people in this world — those who understand binary, and those who don't. |
|
|
|
|
|
Sound like Excel. Can you not achieve this with Microsoft Excel and macros or other spreadsheet app.
Please confirm if Excel is available to you. A C# solution to this could use VSTO(Visual Studio Tools for Office) api
|
|
|
|
|
yes i have excel but i'm trying to make a simpler program for my friend that has just the basic things that he needs. When he tries typing formulas on excel he becomes overwhelmed for some reason so i'm just trying to help him out.
|
|
|
|
|
If your looking for somthing that will have "math type" formulas... your probably biting off more then you can chew... Math parsing is ... complicated. I believe you can find a simple example app if you search codeProject.
I'd blame it on the Brain farts.. But lets be honest, it really is more like a Methane factory between my ears some days then it is anything else...
|
|
|
|
|
I want to know how can only run a single instance of my application using C# and Win API and bring the application to front if user tried to run another instance?
|
|
|
|
|
|
There's loads of examples of this around - this is the code I use (WinForms) which is adapted from code I found somewhere (can't remember where to give credit )
using System;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading;
using System.Windows.Forms;
namespace YourNamespace
{
internal static class SingleInstance
{
#region Fields
private static Form applicationForm = null;
private static string assemblyGuid = null;
private static int message = 0;
private static Mutex mutex = null;
#endregion
#region Properties
private static string AssemblyGuid
{
get
{
if (assemblyGuid == null)
{
object[] attributes = Assembly.GetEntryAssembly().GetCustomAttributes(typeof(GuidAttribute), false);
if (attributes.Length != 0)
assemblyGuid = ((GuidAttribute)attributes[0]).Value;
else
assemblyGuid = string.Empty;
}
return assemblyGuid;
}
}
public static int Message
{
get
{
if (message == 0)
message = NativeMethods.RegisterWindowMessage(String.Format("WM_SHOWFIRSTINSTANCE|{0}", AssemblyGuid));
return message;
}
}
#endregion
#region Methods
public static void Run(Form mainForm)
{
Run(mainForm, false);
}
public static void Run(Form mainForm, bool globalMutex)
{
if (mainForm != null)
{
if (Start(globalMutex))
{
try
{
applicationForm = mainForm;
Application.Run(applicationForm);
}
catch (Exception e)
{
MessageBox.Show(e.Message);
}
Stop();
}
}
}
public static void ShowToFront()
{
if (applicationForm != null)
{
NativeMethods.SetWindowPos(applicationForm.Handle, new IntPtr(-1), 0, 0, 0, 0, NativeMethods.SWP_NOMOVE | NativeMethods.SWP_NOSIZE);
NativeMethods.SetWindowPos(applicationForm.Handle, new IntPtr(-2), 0, 0, 0, 0, NativeMethods.SWP_NOMOVE | NativeMethods.SWP_NOSIZE);
NativeMethods.ShowWindow(applicationForm.Handle, NativeMethods.SW_SHOWNORMAL);
NativeMethods.SetForegroundWindow(applicationForm.Handle);
}
}
private static bool Start()
{
return Start(false);
}
private static bool Start(bool globalMutex)
{
bool createdNew = false;
string name = null;
if (globalMutex)
name = String.Format("Global\\{0}", AssemblyGuid);
else
name = string.Format("Local\\{0}", AssemblyGuid);
Mutex thisMutex = new Mutex(true, name, out createdNew);
if (createdNew)
mutex = thisMutex;
else
NativeMethods.PostMessage(
(IntPtr)NativeMethods.HWND_BROADCAST,
Message,
IntPtr.Zero,
IntPtr.Zero);
return createdNew;
}
private static void Stop()
{
mutex.ReleaseMutex();
}
#endregion
private static class NativeMethods
{
#region Constants
public const int HWND_BROADCAST = 0xffff;
public const int SW_SHOWNORMAL = 1;
public const int SWP_NOSIZE = 0x0001;
public const int SWP_NOMOVE = 0x0002;
#endregion
#region Methods
[DllImport("user32")]
public static extern bool PostMessage(
IntPtr hWnd,
int Msg,
IntPtr wParam,
IntPtr lParam);
[DllImport("user32")]
public static extern int RegisterWindowMessage(
string lpString);
[DllImport("user32.dll")]
public static extern bool SetForegroundWindow(
IntPtr hWnd);
[DllImport("user32.dll")]
public static extern bool SetWindowPos(
IntPtr hWnd,
IntPtr hWndInsertAfter,
int X,
int Y,
int cx,
int cy,
int uFlags);
[DllImport("user32.dll")]
public static extern bool ShowWindow(
IntPtr hWnd,
int nCmdShow);
#endregion
}
}
} A small modification to Program.cs
using System;
using System.Windows.Forms;
namespace YourNamespace
{
internal static class Program
{
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
SingleInstance.Run(new FormMain());
}
}
} Then override WndProc in the main form to receive the message so you can bring it to the front
protected override void WndProc(ref Message message)
{
if (message.Msg == SingleInstance.Message)
SingleInstance.ShowToFront();
base.WndProc(ref message);
}
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Good afternoon.
I was wondering if there was a better was to check for duplicate numbers in an array and if it is not in the array, put it in.
This is what I have so far:
int[] numbers = new int[1000];
private bool RndDuplicate(int intRnd)
{
int index = Array.BinarySearch(numbers, 0, numbers.Length, intRnd);
if (index > 0)
{
return true;
}
else
{
for (int i = 0; i < numbers.Length; i++)
{
if (numbers[i].ToString() == "")
{
numbers[i] = intRnd;
break;
}
}
return false;
}
}
Thank you, WHEELS
|
|
|
|
|
Wheels012 wrote: numbers[i].ToString() == ""
This will always be false.
|
|
|
|