|
I got great help with postings of Dr. Wisam E. Mohammed.
I have a question/query for all those working with mapwindow activeX.
I've added a shapefile of 'countries' to the mapcontrol(mapwingis.axmap). Now i need that upon clicking/selecting a shape, particular information to be showed.
I tried the coding on mousedownevent but i think mapwingis events are not working??
help!!!
|
|
|
|
|
I suggest you find a forum specialized in the use of the mapwindow activeX control. You might get some help here, but it will be more likely on a dedicated forum.
CCC solved so far: 2 (including a Hard One!)
37!?!! - Randall, Clerks
|
|
|
|
|
mayank4everurs wrote: mapwindow activeX
Never heard of it.
|
|
|
|
|
Hi all,
I'm trying to get the global hotkeys working with Linux.
With Windows it is DLLImport user32 but this dll doesn't exist in Linux.
Has anyone an idea how to get global hotkeys working with Linux?
Thanks to all.
|
|
|
|
|
hii man,
you need to write your own implementation of GlobalHooks in c or c++
write down a library and use that one in your c# application or on linux..
grretz
|
|
|
|
|
Thanks for this hint.
But if i do so, ill have to install this lib on every client. Am I right? Or is there any posibility to deliver this lib with the C# project.
I'm not familiar with c#. I use to work with Linux and C++ so if this Questions are a little stupid ... please don't matter
greatz
Armin
|
|
|
|
|
yeah in windows you need to deploy the lib/dll like by installing the app.
using the lib in linux need to be recompiled under linux because the operating system specific api will be used and that one is different as the on in windows see the user32.dll doesn't exists under linux.
hope i could help
|
|
|
|
|
yeah sure, but now i feel a little stupid ...
Using Windows and user32.dll everything works but what do i have to use for Linux.
With C++ it's easy to use global Shortcuts but I don't get it to work in .NET
If anyone has a bit of code to put me to the right way ... the one would be my hero
thanks
Armin
|
|
|
|
|
Hey guys =),
I want to create a ".xls" and ".xlsx" file in C#2008. Creating && saving is no problem, but how can I close it?
I think I've a bug in my code...
Microsoft.Office.Interop.Excel.Application excelApp = new ApplicationClass();
Microsoft.Office.Interop.Excel.Workbook newWorkbook = excelApp.Workbooks.Add(Microsoft.Office.Interop.Excel.XlWBATemplate.xlWBATWorksheet);
Microsoft.Office.Interop.Excel.Sheets excelSheets = newWorkbook.Worksheets;
string currentSheet = "Tabelle1";
Microsoft.Office.Interop.Excel.Worksheet worksheet = (Microsoft.Office.Interop.Excel.Worksheet)excelSheets.get_Item(currentSheet);
worksheet.SaveAs(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\SaveAsTest.xlsx", t, t, t, t, t, t, t, t, t);
but now the question is... "how can I close this worksheet?" a ".close" property doesn't exist...
I read, that I can close the workbook but the workbook uses a already existing file.
Is it possible to assign the new created to a workbook?
greets Mschauder
|
|
|
|
|
It looks like you need the Application.Quit()[^] method; don't you just love Microsoft?
MVP 2010 - are they mad?
|
|
|
|
|
Hey, worked fine!
Now the next problem... my computer uses office 2007, I can open the ".xlsx" && ".xls" file smoothly...
But if I use the laptop with office 2003... sure I can't open the ".xlsx", but why can't I open the ".xls"???
Is there a possibility to save the file, with the natural format for office 2003 (.xls)
greets Mschauder
|
|
|
|
|
I answer now my own question (sorry!):
just use:
t means
object t = Type.Missing;
worksheet.SaveAs("Test.xls", XlFileFormat.xlExcel8, t, t, t, t, t, t, t, t);
and saving as office2007:
worksheet.SaveAs("Test.xls", t, t, t, t, t, t, t, t, t);
|
|
|
|
|
|
hi,
try to set the DisplayStyle to ImageAndText or Text. may this would help
greetz.
|
|
|
|
|
nope, it still doesn't work
|
|
|
|
|
how we can get and set item values in a multicolumn listview?
|
|
|
|
|
I find the documentation[^] is the best starting point.
MVP 2010 - are they mad?
|
|
|
|
|
I want to change the outer border of tablelayoutpanel. NOT THE INNER CELL BORDER bt the OUTER BORDER of the panel.
Tablelayoutpanel has the option for cell borders bt not for the outer border. How to change that.????
Can anybody help me with the code....????
Thanks in advance....
|
|
|
|
|
Because a TableLayoutPanel is derived from a Panel, it has a BorderStyle - it's just that you can't see it in the properties windows (or Intellisense). You can alter it at run time, but not at design time:
tableLayoutPanel1.BorderStyle = BorderStyle.Fixed3D;
Intellisense will not find it when you get to the dot, but keep typing and it will be accepted, and will compile and run cleanly.
All those who believe in psycho kinesis, raise my hand.
My 's gonna unleash hell on your ass. tastic!
|
|
|
|
|
I wrote some code and have problem in line *. I get my modem names correctly but when I want to instantiate a Modem object I face an exception in line * which is: "This modem is invalid".
static void Main(string[] args)
{
TAPI tapi = new TAPI();
bool b = tapi.Initialize();
ArrayList list = tapi.AvailableModems();
* tapi.modem = new Modem(list[1].ToString(), tapi, new IntPtr());
Modem modem = tapi.modem;
modem.Call("6632");
}
list[1] is correct because I checked it and also I should say that my modem is connected to an internal dormitory phone line which I can dial other rooms, so my number in Call() function is just 4 digit long. I wanted to know that is that possible that because my modem is connected to an internal phone line I faced that exception? Excuse me for any mistakes because of my poor English.
modified on Tuesday, February 2, 2010 2:02 AM
|
|
|
|
|
I have this simple code running on my windows server just fine, but when I run it in mono after a couple days I start getting only OutOfMemory exceptions.
public static byte [] TryReceive (Socket sock, out int nLength)
{
nLength = 0;
try {
int size = sizeof(int);
byte [] data;
int recv = 0;
int offset = 0;
data = new byte [size];
while (size > 0) {
recv = sock.Receive(data, offset, size, SocketFlags.None);
if (recv == 0)
return null;
offset += recv;
size -= recv;
}
size = BitConverter.ToInt32(data, 0);
offset = 0;
data = new byte [size];
while (size > 0) {
recv = sock.Receive(data, offset, size, SocketFlags.None);
offset += recv;
size -= recv;
}
nLength = data.Length;
byte [] dataGraph = new byte [data.Length - 1];
Array.Copy(data, 1, dataGraph, 0, dataGraph.Length);
if (BitConverter.ToBoolean(data, 0))
dataGraph = DecompressBytes(dataGraph);
return dataGraph;
}
catch (OutOfMemoryException) { ObeServer.log.Log(1, "OutOfMemory when receiving packet."); return null; }
}
Could someone please see something that might be causing this?
TIA
|
|
|
|
|
In fact this may be an issue with the TCP window size, let me explain that.
Certainly the size that you try to decode is wrong, due to a framing issue.
If it's a TCP, you need to have some sync stuff, you cannot consider with TCP even if it's a connected protocol that the byte you will receive is always here. That's why you need a sync byte (eg. 0x80 for RTP protocol or HTTP string for HTTP....) prior the size.
The windows socket size is different from OSes (eg. Linux and Windows) and the TCP NO WAIT depends on the stack configuration.
So, I advise you to check if the : size = BitConverter.ToInt32(data, 0); is correct and not a very high value which may cause the memory leak.
My two cents
|
|
|
|
|
A typo in my previous mail is that RTP is a UDP protocol not a TCP
|
|
|
|
|
So what you're saying is that even though I make sure to read 4 bytes off the socket they may not be the correct four bytes so when I cast them it converts into a monstrous integer? The server manages flash clients and everytime someone does a postback or otherwise the flash reloads and then reconnects. I wonder if it has todo with old data sitting on the socket from the previous connection. But I do create a new socket everytime they connect, but maybe it has todo with mono's socket pool code. The Sync Byte, how would I go about about implementing something like that and what is it fixing exactly? Is it implemented something like this?
Socket.Send(0x80+Size+Data);
while(true)
{
if(Socket.Receive(0,1)==0x80)
{
size = BitConverter.ToInt32(Socket.Receive(0, sizeof(int)));
break;
}
}
I'm sorry for all the thinking out loud and questions, this error has caused me tons of headache.
Am I thinking in the right direction with that?
|
|
|
|
|
You got it.
The problem with TCP is you may have a text protocol (HTTP, ...) or binary (RDP - remote desktop...)
If your protocol is too weak you can resync, so you may have or not a control.
Send -->
<-- Ack Or Error
If you want to be sure that the message has been delivery, for instance the ftp protocol does this.
case "REST":
...
break;
default: //We Don't understand the Command
SendMsg("500 Command not understood\r\n",ref outBuffer);
break;
My advise, is read you socket buffer normaly, check at the beginning that you have a signature 0x80 (for instance), if not consume the buffer, and wait for another packet, or another option, search for the sync byte.
On heavy traffic, the tcp stack may overloaded, in this case you may have in your buffer.
First Read
0x80 xx xx xx xx 0x80
Second Read
xx xx xx xx 0x80 xx
Third Read
xx xx xx 0x80 xx xx
....
You can mark the start and the stop of your packet, start with a 0x80 and then get the size (which gives the size), you can break and split you data, and consume. Place your uncomplete packet in a waiting queue, and wait for the following one. When received, add it to the end, check that the size matches the new packet, if not drop it and resync.
A bit complex at the beginning, but I can insure that it works fine in all cases. Trust me I work in the telcom area, I know what is TCP over load... thanks to the Apple phone
|
|
|
|
|