|
the "F4" is for "my" app, and my app launch standard windows "Save as" dialog
|
|
|
|
|
igalep132 wrote: the "F4" is for "my" app, and my app launch standard windows "Save as" dialog
So you just need some pice of communication that will allow your path to be sent to your app. Take a look at Luc's answer (and link) below, it will probably help with what you need to do.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
more precisely, you could pass a pointer to a string through LPARAM, however that pointer must point to some valid memory in the target process; this requires some P/Invoking of kernel functions such as AllocateVirtual, ReadProcessMemory, WriteProcessMemory. I once developed a little LP_Process class that encapsulates all this, see e.g. here: LP#TrayIconBuster[^]
|
|
|
|
|
i have done the encryption for black and white images but the processing time is high as the size increases.i want a help to lower the process time. i like to know how to modify for color images.i have done the encryption using the base paper"A hash based image encryption algorithm" from a journal published by Elsevier
|
|
|
|
|
Why would a colour image be any different from black and white? (in terms of how you process it)
Also, depending on format of image color and black and white may be the same data size
More info on you code please!!!
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
you should implement encryption on either a file or a data stream, that would allow you to encrypt just anything, and performance would only depend on amount of data, nothing else. Whether it is a color image, a B/W image, an EXE file, ... it does not matter.
|
|
|
|
|
In addition to Luc's suggestion of encrypting off a file stream, have you considered compressing before encrypting? Assuming that your images are not JPG (or some other format that is already compressed) you might get a major benefit from compression.
|
|
|
|
|
Hello,
What I am trying to achieve is as follows... I have a database used in an asp.net web app and one of the functions is for a user to download a copy of the database but only with data related to the user. For this I want to provide them with a .MDF file.
What is the best way to create a .MDF file on the fly? From what I understand SQL Server needs to be used but I do not want to create a database in an SQL instance and then have to work out how to detach that database. (This would also be an issue if 2 or more users try to do it at the same time as I would ideally want the database files to be named the same (I have temp folders set up for storing same name files for different users already))
Anyone have any thoughts on this?
Thanks
BTW, apologies for any who think this should go in the database forum (I don't think that quite suits)
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Hi,
Maybe you should take a look at Synchronization Framework.
AFAIK you can't use a mdf file outside a SQL Server instance. But you can get .sdf (SQL Server Ce) file from your main database to provide offline access to data.
I can't say much more about that, since I didn't implemented it yet, but I would start searching in that field if I were to deal with such a requirement.
Kind regards.
modified on Wednesday, November 10, 2010 11:04 AM
|
|
|
|
|
Thanks for the reply, will take a look into it. Not sure it is what I am looking for but maybe it will provide a solution in one form or another.
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
As an alternative, you could export the data as an Access database, or a zipped XML file. But do check out the sync framework - imagine the user updating his/her own local database, and having the sync framework update your master-database
I are Troll
|
|
|
|
|
I have decided to go for the option of creating a database in SQL Instance, copying what I need to copy and then detaching the database. This allows me to then provide the .MDF file for download
Just to clarify I am not actually looking to provide any kind of re-import of the data. The download is purely for customers to be able to get their data that we are storing on our DB. For whatever reasons they may want
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
HI !!!
using windows application, i want to validate in datagridview two columns.
In datagridview, one column is Name and another is age.
my requirement is the both columns not Left blank and enter only character in name column and number only Age column
thanx
|
|
|
|
|
Are you asking for permission? If so, then please go ahead and do it - I have no objections whatsoever.
If not, then perhaps you should clarify what you do want.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
Cells in DataGridViews have a Validating event. Look here[^] for how to use it.
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.”
|
|
|
|
|
Hello Expert
I am facing a a problem from couple of weeks but net getting solution for that
The stuation is ..
I am sending a string from one application(written in c#) to another application(written in C++) in same machine using WM_COPYDATA.
It is going fine with windows xp but while i am trying to run on windows 7 machine its going blank string (c++ application received null value).
can you please help me out to solved this issue, i am unable to understand what could be the reason
I will appriciate your help
Thanks & Regards
Shafiq
|
|
|
|
|
I think there might be many causes so, before trying an answer, I think I need some information:
- Can you show us the line where you have imported SedMenssage function to your C# application?
- Can you show us the code snippet where you call SendMessage function in your C# application?
- Can you show us the code snippet where you handle the WM_COPYDATA message in your C++ application?
Maybe this could help us to help you.
|
|
|
|
|
Hello Erik
Here are my code C# code to send message...
public const int WM_COPYDATA = 0x004a;
[StructLayout(LayoutKind.Sequential)]
public struct COPYDATASTRUCT
{
[MarshalAs(UnmanagedType.I4)]
public int dwData;
[MarshalAs(UnmanagedType.I4)]
public int cbData;
[MarshalAs(UnmanagedType.LPStr)]
public string lpData;
}
string reqFiles ="Some value";
COPYDATASTRUCT data = new COPYDATASTRUCT();
data.dwData = 0;
data.cbData = reqFiles.Length * 2;
IntPtr lpStruct = Marshal.AllocHGlobal(Marshal.SizeOf(data));
Marshal.StructureToPtr(data, lpStruct, false);
Process[] processes1 = Process.GetProcessesByName("ProcessID");
IntPtr hTarget = processes1[0].MainWindowHandle;
SendMessage(hTarget, WM_COPYDATA, this.Handle, lpStruct);
//-----------------This is to receive message in C++ ------------------------------------
LRESULT APIENTRY MAxSubclassProc(
HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam)
{
if (uMsg==WM_COPYDATA)
{
char str[256];
COPYDATASTRUCT *cds;
cds=(COPYDATASTRUCT *)lParam;
// receiving/handling message
}
}
If anything needed pls let me know..
Please help me to run in windows 7 machine.
Regards
shafiq
|
|
|
|
|
Ok. I think the problem is with your COPYDATASTRUCT. This is how it is declared in winuser.h:
typedef struct tagCOPYDATASTRUCT {
ULONG_PTR dwData;
DWORD cbData;
PVOID lpData;
} COPYDATASTRUCT, *PCOPYDATASTRUCT;
And these are the lines which declare ULONG_PTR and DWORD data types:
typedef unsigned __int3264 ULONG_PTR;
typedef unsigned long DWORD, *PDWORD, *LPDWORD;
So ULONG_PTR is like a 32 bit unsigned integer in a 32 bit platform and a 64 bit unsigned integer in a 64 bit platform, and DWORD is always a 32 bit unsigned integer. Nevertheless, you are using the int type and MarshalAs.UnmanagedType.I4 for both of them in your C# declaration, I mean, you treat both of them as 32 bit signed integer. It will usually work in a 32 bit platform (though it could fail), but it will usually fail in a 64 bit platform. In a 64 bit platform you should change the COPYDATASTRUCT declaration in your C# application like this:
StructLayout(LayoutKind.Sequential)]
public struct COPYDATASTRUCT
{
[MarshalAs(UnmanagedType.U8)]
public ulong dwData;
[MarshalAs(UnmanagedType.U4)]
public uint cbData;
[MarshalAs(UnmanagedType.LPStr)]
public string lpData;
}
I am not sure if it would work in a 32 bit platform becouse I don't know if dwData value would be appropiately truncated. You can try and if it does not work on a 32 bit platform you will have to make two versions of the struct. In this case, the 32 bit version of the struct should be like this:
StructLayout(LayoutKind.Sequential)]
public struct COPYDATASTRUCT32
{
[MarshalAs(UnmanagedType.U4)]
public uint dwData;
[MarshalAs(UnmanagedType.U4)]
public uint cbData;
[MarshalAs(UnmanagedType.LPStr)]
public string lpData;
}
You have the System.Environment class to know which platform you are using. If you are using 4.0 version of .NET you can use System.Environment.Is64BitOperatingSystem, and if you are using a previous version of .NET you will have to go a little deeper into System.Environment (OSVersion, Platform, etc.).
|
|
|
|
|
hi Erik
Bad luck for me but anyhow thanks for nice reply..
If you get any other solution please let me know.
Thanks
|
|
|
|
|
I just finished writing my own library using WM_COPYDATA, and would happy to help you.
I've learnt a few interesting things about WM_COPYDATA, like this:
- It doesn't work across UAC, i.e. communicating processes must run in the same trust level for the messaging to work;
- This messaging doesn't work for different bit platforms, i.e. communicating processes must be either 32-bit or 64-bit, no mix is supported.
If you interested, my library allows easy communication with WM_COPYDATA for any .NET application
|
|
|
|
|
Hi,
Is it possible to get computer name from "IP_adress" in local network.
|
|
|
|
|
Use Dns.GetHostEntry to retrieve an IPHostEntry , and get the HostName from this.
|
|
|
|
|
Try System.Environment.MachineName
..Go Green..
|
|
|
|
|
Ankurm/ wrote: System.Environment.MachineName
Simple way of getting MachineName
you should focus on question which is about get Computer Name based on Ip Address and Pete O'Hanlon answered better and noting can be better than.
|
|
|
|