|
Hi
I need to transfer big file from PC to PPC - but I can't use RAPI.
My work is:
1. convert .sdf (big) file to binary file
2. transfer to PPC (through Webservice)
3. In PPC I convert from binary to .sdf file
the problem is, that in PPC I got an exception "out of memory" (in big file)
in small file - it work excellent.
what can I do ? maybe I can send in slices ?
thank's for any help
I work on C#
|
|
|
|
|
Hi all.
How can we use AutoCompleteCustomSource for a TextBox ?
I've searched Google , but I couldn't find anything special !
Could you guide me ?
Thanks in advance.
|
|
|
|
|
This will return an autoComplete TextBox with the Greek leters as custom source.
private TextBox CreateAutoCompleteTextBox()
{
TextBox result = new TextBox();
AutoCompleteStringCollection autoCompleteStrings = new AutoCompleteStringCollection();
autoCompleteStrings.AddRange(new string[]{
"Alpha",
"Beta",
"Gamma",
"Delta",
"Epsilon",
"Zeta",
"Eta",
"Theta",
"Iota",
"Kappa",
"Lambda",
"Mu",
"Nu",
"Xi",
"Omicron",
"Pi",
"Rho",
"Sigma",
"Tau",
"Upsilon",
"Phi",
"Chi",
"Psi",
"Omega"
});
result.AutoCompleteCustomSource = autoCompleteStrings;
result.AutoCompleteSource = AutoCompleteSource.CustomSource;
result.AutoCompleteMode = AutoCompleteMode.Suggest;
return result;
}
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Thanks you very much DaveyM69.
But I have a MultiLine Textbox and it doesn't work on it.
|
|
|
|
|
Yeah - the built in autocomplete doesn't work with multiline. You'll need to 'roll your own' control to do this I think.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Thanks anyway
|
|
|
|
|
I'm trying to get an output array from a function in an unmanaged DLL into my C# application. I've already done some googling on this topic and while I've found some articles, none of the suggestions seem to work.
The DLL has a function prototype of
int GetData(int ID, float* Results)
The int that is returned is the length of the array
Internally to send the results back it does
Results=new float[length];
In my C# application I use a delegate to get the function results:
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate int delGetData(int TagID, ref IntPtr Results);
I then try and retrieve the results and copy to a managed array doing this:
IntPtr data=IntPtr.Zero;
int Len=GetData(ID, ref data);
if(Len==0)
float[] results=new float[Len];
Marshal.Copy(data, results, 0, Len);
I always get an exception on the Marshal.Copy because the source (data) is null.
I have some control over the unmanaged DLL, any suggestions on how to get these to interface?
Thanks
modified 12-Jul-20 21:01pm.
|
|
|
|
|
|
Thank you I'll look into these
modified 12-Jul-20 21:01pm.
|
|
|
|
|
Hi,
If data gives a NullReferenceException, something must be wrong in the unmanaged code; here are some possibilities:
1. a silly mistake, say "return 0;"
2. your function pointer (accepting the delegate) not being defined as __stdcall
3. something going wrong with parameter alignment on stack (native long=32 bit, managed long=64 bit;
native char=8 bit, managed char=16 bit); this assumes your post was showing simplified code only.
4. IntPtr needs a 4 or 8 byte pointer, depending on Win32/Win64; your native code must match that.
As far as P/Invoke goes:
I prefer to allocate arrays, structures, objects on the managed side, and somehow pass their pointer to the unmanaged world; this has the advantage of being a managed object from the start, and not requiring any copying, and the disadvantage it is difficult to achieve when there are unknown values, such as the array size.
However, you are using a delegate to pass results, so you could instead use two delegates:
- one to inform the managed world about the array size, and ask for an array pointer;
- one to signal the managed world the array has been filled.
Passing a pointer can be done in two ways:
- with the "fixed" keyword; simple, unless the array must remain fixed afterwards, as in your case.
- with the GCHandle class; don't forget to eventually free the handle!
BTW: you were using the ref keyword, "out" would have been more appropriate.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Thanks for the specifics! I think I can work with this
modified 12-Jul-20 21:01pm.
|
|
|
|
|
For to change is SSIS a package which should import much DBF files on a server, DBF different structure (I receive structure of each table and I create it on a server). A problem only with mappings. As in an existing package programm to make Mappings. Help please, it is very necessary. Soryy for bad English I from Russia. Thanks.
|
|
|
|
|
Hi
I have an excel project with two columns Number and name, where Number contains ('4114','8900','3311-123-2').
I read it in c# using:
string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\temp\\test.xls;Extended Properties=""Excel 8.0;HDR=YES;""";
command.CommandText = "SELECT Number, Name FROM [Projekter$]";
string nummer = dr["Number"].ToString();
The problem is that '4114','8900' are displayed correct, while '3311-123-2' is empty.
Can anybody please help me?
|
|
|
|
|
Hi,
I am trying to do code for status bar and i want to add any image in status bar and instruction from keyboard which will be highlighted on status bar like if use CAPS or INSERT from key board.
kindly guide me what i have to do and how penal i should be arrange for my task.
Thanks
|
|
|
|
|
Use event KeyDown, if for example CapsLock pressed, then set the image in statusbar.
For example, you are using ToolStripStatusLabel, then set it to :
toolStripStatusLabel1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripStatusLabel1.Image")));
Use the designer, and see the code behind it in ...Designer.cs.
|
|
|
|
|
I want image when form load and i have text like CAPS on status bar it is not highlighted initially but when i pressed caps lock then text on status bar which is CAPS must be highlighted
on which event i can do these task.
Thanks
|
|
|
|
|
Take a look at this[^] article from CodeProject. It should help you solve at least part of your problem.
Remember! Google is your friend.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Here you go,
Add images caps_on and caps_off in the resources,
then add below code into your form class..
private bool bCapLock = false;
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (keyData == Keys.CapsLock)
{
if (!bCapLock)
{
toolStripStatusLabel1.Image = Properties.Resources.caps_on;
bCapLock = true;
}
else
{
toolStripStatusLabel1.Image = Properties.Resources.caps_off;
bCapLock = false;
}
}
return base.ProcessCmdKey(ref msg, keyData);
}
Hope this can help.
*12Code
modified on Tuesday, April 7, 2009 10:30 AM
|
|
|
|
|
i want to get the currency value from a website to my local database for developing a component,My database(sql server 2005) to be updated automatically.
|
|
|
|
|
Be more specific about your problem. If you expect somebody to come up with the code for your requirements, you are on the wrong site. Try Rentacoder.com.
|
|
|
|
|
|
Sounds like you want to do some screen scraping, unless they offer a webservice.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Hi all,
The following code can popup a particular Outlook contact detail
Click button 1, it opens Tom Lee contact detail
Then, close the Tom Lee contact detail
Click button 2, it opens Sam Green contact detail
It works fine ...
However, if I am going to open both contact detail (without closing the other person contact)
it will come up with an error >>> "A dialog box is open. Close it and try again"
Any body knows how to solve it ?? Thanks
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using Outlook = Microsoft.Office.Interop.Outlook;
namespace testing1
{
public partial class Form1 : Form
{
Outlook.Application oApp = new Outlook.Application();
string firstName;
string lastName;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void FindContactEmailByName() {
Outlook.NameSpace outlookNameSpace = oApp.GetNamespace("MAPI");
Outlook.MAPIFolder contactsFolder = outlookNameSpace.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderContacts);
Outlook.Items contactItems = contactsFolder.Items;
try
{
Outlook.ContactItem contact = (Outlook.ContactItem)contactItems.Find(String.Format("[FirstName]='{0}' and " + "[LastName]='{1}'", firstName, lastName));
if (contact != null)
{
contact.Display(true);
}
else
{
MessageBox.Show("The contact information was not found.");
}
}
catch (Exception ex)
{
throw ex;
}
}
private void button1_Click(object sender, EventArgs e)
{
firstName = "Tom";
lastName = "Lee";
popup();
}
private void button2_Click(object sender, EventArgs e)
{
firstName = "Peter";
lastName = "Green";
popup();
}
void popup() {
Thread th = new Thread(FindContactEmailByName);
th.Start();
}
}
}
|
|
|
|
|
How can i create a setup project to my c#.net 3.5 windows application
please give details or some links.
--Thanks
Naren
|
|
|
|
|
try searching it in msdn.microsoft.com.
You can also look at VS2003 or VS2005, it is still the same.
|
|
|
|
|