|
I would like to get a list of images associated with file extentions on a base system to make my application look more proffesional.
I will have a list of extentions that I will want for each list view that is activated, and would only require a look up the icons as it is activated (Unless there is a better way of doing this, but i'd like to avoid importing every image in the system).
How can I get a list of icons, and their association from the system?
Thanks
Cata
|
|
|
|
|
|
Hi, I'm making the LineChartControl.
I want to provide controlable interface to user.
It's means, if you add a line to chart, then LineChartControl add a layer to Control like a PhotoShop.
Also can control a line's visible status.
It's applicable to make a drawing Application.
Please, give me an idea.
|
|
|
|
|
A layered image is really lots of images drawn on top of one another. You can create this by selecting a colour to be a transparency mask, making images with this colour to start with and using the draw method that takes a colour range to draw transparently. Or you can do it manually, as photoshop would, by maintaining a 1 bit image as a mask for each layer.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
I have a question about replace system DLL with my owens.
then I can use my functions to repleace API functions.
As far as I know ,I must wirte DLL with C++.I have seen
some code about it .It use ASM in it.That is ok .
but in vc++,we can do it with the help of _ASM{ }
but when I want to do it use C#.I do not know anything .
I hope someone to help me. Thank you .
sdfasd
|
|
|
|
|
There is so many things wrong with this I don't know where to begin...- You can't replace system DLLs in newer OSes because they'll put the cached copies right back.
- I doubt your coding is any better than a large team of Microsoft developers.
- You can't replace system DLLs with managed assemblies because native DLLs are loaded directly without a host for the CLR by the executable loader.
- You can't use assembler in managed code because assembler is as unmanaged as you can get, but you can use unsafe code for pointer manipulation.
And if you say something like - and I quote - I do not know anything ., that's a pretty good sign that you shouldn't start replacing any DLLs because it's not a trivial task and - as I said before - isn't possible in newer Windows OSes (unless System Restore is turned off).
Besides, you would have to replace ALL functions exported in a DLL and - many times - several of those functions are undocumented so there's no way to know what they should do based on any given set of parameters.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
lajiyo wrote:
I do not know anything .
Amen.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
That sounds like a really bad idea. Why on Earth do you want to replace system DLLs?
I am so glad that modern OSes see this happening and say "Sod this for a jaffa-cake" and restore the appropriate DLL.
--Colin Mackay--
"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)
|
|
|
|
|
csc -nostdlib
Now have fun and contact us when you done
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
Hi, everybody.
I have a little problem.
I use for work with database 'Microsoft Jet 4.0 OLE DB Provider', but I have a problem with integration of the project. How can I install only 'Microsoft Jet 4.0 OLE DB Provider'.
Thank's.
|
|
|
|
|
I've already answered your questions, and I am a professional consultant for several companies (in the past and currently) for Windows Installer, and am currently working on the MSI 3.0 beta testing team.
Notice the emphasized string in 'Microsoft Jet 4.0 OLE DB Provider'? That means that it is an OLE DB provider and that requires the MDAC 2.6 or above to use with ADO.NET. There is simply no way around it.
You need to install the MDAC 2.6 or higher MSM. You can find these all over the 'net and it is easy to make. As I stated before, InstallShield has both MSMs for MDAC 2.7 SP1 (http://saturn.installshield.com/isd/mergemodules/801/MDAC27/MDAC27ENU.msm[^]) and Jet 4.0 SP6 (http://saturn.installshield.com/isd/MergeModules/EnglishMM/Jet40SP6/Jet40.msm[^]). They do have MSMs for MDAC 2.8 and Jet 4.0 SP7, but there's no link to download. See the following page for many more merge modules to download: http://www.installshield.com/downloads/modules.asp?prod=wind&lan=english&xmlUse=y[^]
All you need to do is add these MSMs to your project correctly. That's it. They are called merge modules because the tables that make up the MSM are merged with your installer when your install package is compiled. The only thing you might have to do is specify a target redirect (or default path) for the files in the MSM when you add it. Just specify the Windows\System32 directory ([SystemFolder] in Windows Installer) and that's it.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hi
Im try to get the icq api to work in c# but i trapped into a big problem.
The dll-function:
ICQAPICall_GetOnlineListDetails
BOOL WINAPI ICQAPICall_GetOnlineListDetails(int &iCount, BPSICQAPI_User **ppUsers);
In (Arguments): None
Out (Returns): iCount, ppUsers
iCount - the number of Users to follow
ppUsers - a pointer to the users’ array.
Description: The data returned is in the order of the online list, top to bottom. The users array is initialized with the user’s ICQ# (m_iUIN field) and the Window Handle (m_hFloatWindow) if the user is “floating”. The users array should be freed by calling ICQAPIUtil_FreeUsers to free each user structure and the array itself.
The iCount Parameter i get correctly with passing "out iCount" to the function (it will return the exact count), but the array gets size 1 and consists garbage. I used this:
[MarshalAs(UnmanagedType.LPArray)]
BSICQAPI_User[] ppUsers //its a array of structs.
It doesnt matter if i do ref or not in the function header.
Does somone know how i can get the right parameter for BPSICQAPI_User **ppUsers ?
THX
sorry for my bad english
|
|
|
|
|
Try this:
[DllImport("whatever.dll")]
bool ICQAPICall_GetOnlineListDetails(
[MarshalAs(UnmanagedType.I4),Out]out int iCount,
[MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0),Out]out BPSICQAPI_User[] ppUsers); Then, make sure that your BSICQAPI_User struct is defined to exactly match the structure in C++, meaning that you might even have to use the ManageAsAttribute on various fields in the struct. Since the OutAttribute is specified and the out keyword is used, then make sure you instantiate a large enough array before passing it to the method:
int count = 0;
BSICQAPI_User[] users = new BSICQAPI_User[40];
ICQAPICall_GetOnlineListDetails(out count, out users);
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
thx for i that works but with the array i get an error.
System.Runtime.InteropServices.MarshalDirectiveException'
Additional Information:: SizeParamIndex can not be used for byref-Arrayparameters
when i remove this i get the same garbage like before...
|
|
|
|
|
Are you sure you defined the structure right, even providing all the necessary MarshalAsAttribute values? You could also trying using out IntPtr ppArray as that second parameter and then using Marshal.PtrToStructure(ppArray, typeof(YourStruct)) .
[edit]
Oh, and I forgot, you don't actually need to initialize the array for an out parameter. Sorry about that.
[/edit]
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
my struct conversion:
typedef struct
{
int m_iUIN;
HWND m_hFloatWindow;
int m_iIP;
char m_szNickname[20];
char m_szFirstName[20];
char m_szLastName[20];
char m_szEmail[100];
char m_szCity[100];
char m_szState[100];
int m_iCountry;
char m_szCountryName[100];
char m_szHomePage[100];
int m_iAge;
char m_szPhone[20];
BYTE m_bGender;
int m_iHomeZip;
// Version 1.0001
int m_iStateFlags;
} BSICQAPI_User;
[StructLayout(LayoutKind.Sequential, Pack=1)]
public struct BSICQAPI_User
{
public int m_iUIN;
uint m_hFloatWindow;
public int m_iIP;
[MarshalAs( UnmanagedType.ByValArray, SizeConst=20)]
public char[] m_szNickname ;
[MarshalAs( UnmanagedType.ByValArray, SizeConst=20)]
public char[] m_szFirstName ;
[MarshalAs( UnmanagedType.ByValArray, SizeConst=20)]
public char[] m_szLastName ;
[MarshalAs( UnmanagedType.ByValArray, SizeConst=100)]
public char[] m_szEmail;
[MarshalAs( UnmanagedType.ByValArray, SizeConst=100)]
public char[] m_szCity;
[MarshalAs( UnmanagedType.ByValArray, SizeConst=100)]
public char[] m_szState;
public int m_iCountry;
[MarshalAs( UnmanagedType.ByValArray, SizeConst=100)]
public char[] m_szCountryName ;
[MarshalAs( UnmanagedType.ByValArray, SizeConst=100)]
public char[] m_szHomePage ;
public int m_iAge;
[MarshalAs( UnmanagedType.ByValArray, SizeConst=20)]
public char[] m_szPhone ;
public byte m_bGender;
public int m_iHomeZip;
public int m_iStateFlags;
}
|
|
|
|
|
Are you sure you should be specifing a pack size of 1? You didn't show that in the native definition (and I really don't have time to dig through the ICQ APIs). Try this, though:
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)]
{
public int m_iUIN;
public IntPtr m_hFloatWindow;
public int m_IP;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=20)]
public char[] m_szNNickname;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=20)]
public char[] m_szFirstName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=20)]
public char[] m_szLastName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=100)]
public char[] m_szEmail;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=100)]
public char[] m_szCity;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=100)]
public char[] m_szState;
public int m_iCountry;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=100)]
public char[] m_szCountryName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=100)]
public char[] m_szHomePage;
public int m_iAge;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=20)]
public char[] m_szPhone;
public byte m_bGender;
public int m_iHomeZip;
public int m_iStateFlags;
} Basically, you have it right, although I'd use UnmanagedType.ByValTStr instead, and specify your CharSet=CharSet.Ansi in StructLayoutAttribute . Keep in mind that all characters in .NET are stored in Unicode and assumed to be as such. Without specifying this property in the attribute, either CharSet.Unicode or CharSet.Auto (Ansi in Windows, Unicode in NT) would most likely be assumed, which may be why at least your strings are messed up assuming that you're on NT since the .NET SDK requires it (but there's a trick to install it on Windows 98 or ME).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
hi ,
i have a big fat problem i cant solve and it _should_ be simple!
i want to exacute a quite slow query via an asp.net page , teh query can take everything form 1sec to 10 minutes (its for our inhouse statistics system.. 10 min is very uncommon but i does happend sometimes)
ive set teh "connect timeout=9999" in the connectionstring , and the sqlconnection object says that the timeout is indeed 9999 if i look at the connectiontimeout property.
ive also set the script timeout to 9999 in the global.asax
yet the page dies after 15 sec when i run this query..
WHY???
what other timeout can there be???
//Roger
|
|
|
|
|
Hello,
i think you should try to set the CommandTimeout property of your SQL-Command to 9999.
SqlCommand myCommand = new SqlCommand();
myCommand.CommandTimeout = 15;
myCommand.CommandType = CommandType.Text;
|
|
|
|
|
that worked,
thanks..
//roger
|
|
|
|
|
I am searching for a .NET API capable of converting (encoding/decoding) WAV and MP3 sound files. (WAV->MP3, MP3->WAV).
It has to be freeware.
I have looked at the lame encoder, which can do the converting, but it doesn't come with a .NET wrapper (and I don't have the skills to create one ). I have seen a small .NET wrapper for the lame encoder somewhere, but it doesn't do what I want.
Have anyone made a .NET wrapper for the lame encoder doing both MP3 encoding and decoding?
Are there any other APIs out there?
Øyvind
|
|
|
|
|
You could download the DirectX 9.0 SDK with the managed assemblies that were written from scratch for DirectX 9.0. Then you can change the WAV decoder with the MP3 encoder and a file writer. This is actually what a lot of encoders / decoders do, since it is a flexible system that is very extensible (you can mix and match readers, decoders, mixers, encoders, and writers in practically any way).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Wow, that sounds interesting.
I'm not sure if I understand this: DirectX 9.0 SDK comes with an MP3 encoder and decoder, or do I include a MP3 encoder of my choice?
I have only used the DirectX 9.0 SDK lightly, so I guess I have some reading to do
Thanks,
Øyvind
|
|
|
|
|
It uses decoders, encoders, mixers, and variuos DMOs install on the system. You'll still need an encoder, but you can get those from various places and some programs will install one as well.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Ok, thanks for your help.
Is this DirectSound specifics or do I look other places in the DirectX 9.0 SDK?
Since I am a beginner with all this, would you give me a URL into MSDN or something so that I know where to start?
Sorry if all these are newbe questions
Øyvind
|
|
|
|