has anyone managed to get a DBLookupComboBox to work with a DBCtrlGrid?
a pre filled in DBComboBox works ok, but it dose not work to well for lookup tables;
delphi 7
In C# it is possible to create weak references to objects as described here:
WeakReference Class
In .net some classes also implement the IDisposable interface. Calling the Dispose method of this interface is performed to manually dispose of any managed or unmanaged resources currently being held onto. An example might be a Bitmap object or class.
If I assign an object that implements IDisposable to a weak reference, will Dispose be called if the weak reference collects the object?
Hey,
I have a tableview which content is managed through core data. When I select a row, a details view is pushed in and shows more information. How can I jump to the next record (the one below the one I selected in the tableview before) through a "next" button in the view ? Same for a previous button, but that should be very similar ...
thx a lot !
Sebastian
I like to be able to view datatable in windows form
I managed to get the headers only with ListView how to get the data in there
DataTable data = new DataTable();
data = EnumServices();
//create headers
foreach (DataColumn column in data.Columns)
{
listView_Services.Columns.Add(column.ColumnName);
}
I just want to show now the data in there!
cheers
I am adding a glow animation effect to a logo. So far, I have managed to get the glow image behind the logo, using a LayeredDrawable, but I can't figure out how to animate it. I have found that AlphaAnimation would achieve the desired effect, but unfortunately I can only apply it on Views, not Drawables. How can I achieve this effect?
I managed to set the compiler to execute another program when the project is built/ran with the following directive in project options:
call program.exe param1 param2
The problem is that the compiler executes "program.exe" and waits for it to terminate and THEN the project executable is ran.
What I ask: How to set the compiler to run both executables in paralel without waiting for the one in PostBuild event to terminate?
Thanks in advance
I'm looking for any database framework/library for .net which will act as a unified layer between an application and databases. Please note that I'm not interested in querying/updating data (there is plenty of DALs for that) but rather a framework which allows me to manage table schemas and indexes in a managed fashion (without using database specific SQL). I'm particularly interested in a library which supports Oracle, SQL Server and PostreSQL.
The release notes for Java NIO (in Java 1.4+) state that support for direct ByteBuffers is an optional feature. I am curious which JVM vendors/flavors do not support it? Should a JNI library always code for managed ByteBuffers and relegate direct ByteBuffers as an optimization?
Thanks
I see some application that uses the settings bundle for their app. Example: http://knol.google.com/k/usman-ismail/iphone-sdk-application-preferences#. I was wondering how to do that without it appearing at the user main settings. I see some application managed to do that. Is there any tutorial around?
Is there any crossplatform way (Windows, Linux, MacOSX) to change screen resolution? Neither Java nor .Net-Mono can do it. Only through native API invocation. It's very strange situation: there are clear (managed) methods to obtain screen resolution, but method for setting is absent. Is this feature very dangerous or complicated?
Does any other crossplatform system (Parrot, RealBasic etc.) do this?
I'm trying to use the following code to convert a native string to a managed string in C++\CLI:
System::String^ NativeToDotNet( const std::string& input )
{
return System::Runtime::InteropServices::Marshal::PtrToStringAnsi( (static_cast<LPVOID>)( input.c_str() ) );
}
I originally found the code here:
But when I try to build it throws the error:
syntax error : identifier 'LPVOID'
Any idea how to fix this?
I can't seem to find how to do geo targeting (filtering a post based on the location of a user) on facebook using their API.
Does anyone already managed to do it?
This is how you can do it via their interface:
Just started with JQuery and I've managed to pass a parameter using POST, firebug confirms this:
Parameters
link [email protected]
Source
link=test1%40test.com
I don't know how to access the link parameter from the receiving page using JQuery, it must be so simple but everything I've been searching through (jquery website, SO, etc) mentions everything but this.
Thanks,
Alex
Hi All,
I m using autocomplete from
http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/
jQuery Autocomplete plugin 1.1
i managed to get data from server in below form with sepaerator to id as "-", but i dont want to show this id in list while selecting but sending it as hidden data.Please suggest.
Exon: Supplier HJR/VAKJ -1
I'm having trouble calling functions of a native library from within managed C# code. I am developing for the 3.5 compact framework (Windows Mobile 6.x) just in case this would make any difference.
I am working with the waveIn* functions from coredll.dll (these are in winmm.dll in regular Windows I believe). This is what I came up with:
// namespace winmm; class winmm
[StructLayout(LayoutKind.Sequential)]
public struct WAVEFORMAT
{
public ushort wFormatTag;
public ushort nChannels;
public uint nSamplesPerSec;
public uint nAvgBytesPerSec;
public ushort nBlockAlign;
public ushort wBitsPerSample;
public ushort cbSize;
}
[StructLayout(LayoutKind.Sequential)]
public struct WAVEHDR
{
public IntPtr lpData;
public uint dwBufferLength;
public uint dwBytesRecorded;
public IntPtr dwUser;
public uint dwFlags;
public uint dwLoops;
public IntPtr lpNext;
public IntPtr reserved;
}
public delegate void AudioRecordingDelegate(IntPtr deviceHandle, uint message, IntPtr instance, ref WAVEHDR wavehdr, IntPtr reserved2);
[DllImport("coredll.dll")]
public static extern int waveInAddBuffer(IntPtr hWaveIn, ref WAVEHDR lpWaveHdr, uint cWaveHdrSize);
[DllImport("coredll.dll")]
public static extern int waveInPrepareHeader(IntPtr hWaveIn, ref WAVEHDR lpWaveHdr, uint Size);
[DllImport("coredll.dll")]
public static extern int waveInStart(IntPtr hWaveIn);
// some other class
private WinMM.WinMM.AudioRecordingDelegate waveIn;
private IntPtr handle;
private uint bufferLength;
private void setupBuffer()
{
byte[] buffer = new byte[bufferLength];
GCHandle bufferPin = GCHandle.Alloc(buffer, GCHandleType.Pinned);
WinMM.WinMM.WAVEHDR hdr = new WinMM.WinMM.WAVEHDR();
hdr.lpData = bufferPin.AddrOfPinnedObject();
hdr.dwBufferLength = this.bufferLength;
hdr.dwFlags = 0;
int i = WinMM.WinMM.waveInPrepareHeader(this.handle, ref hdr, Convert.ToUInt32(Marshal.SizeOf(hdr)));
if (i != WinMM.WinMM.MMSYSERR_NOERROR)
{
this.Text = "Error: waveInPrepare";
return;
}
i = WinMM.WinMM.waveInAddBuffer(this.handle, ref hdr, Convert.ToUInt32(Marshal.SizeOf(hdr)));
if (i != WinMM.WinMM.MMSYSERR_NOERROR)
{
this.Text = "Error: waveInAddrBuffer";
return;
}
}
private void setupWaveIn()
{
WinMM.WinMM.WAVEFORMAT format = new WinMM.WinMM.WAVEFORMAT();
format.wFormatTag = WinMM.WinMM.WAVE_FORMAT_PCM;
format.nChannels = 1;
format.nSamplesPerSec = 8000;
format.wBitsPerSample = 8;
format.nBlockAlign = Convert.ToUInt16(format.nChannels * format.wBitsPerSample);
format.nAvgBytesPerSec = format.nSamplesPerSec * format.nBlockAlign;
this.bufferLength = format.nAvgBytesPerSec;
format.cbSize = 0;
int i = WinMM.WinMM.waveInOpen(out this.handle, WinMM.WinMM.WAVE_MAPPER, ref format, Marshal.GetFunctionPointerForDelegate(waveIn), 0, WinMM.WinMM.CALLBACK_FUNCTION);
if (i != WinMM.WinMM.MMSYSERR_NOERROR)
{
this.Text = "Error: waveInOpen";
return;
}
setupBuffer();
WinMM.WinMM.waveInStart(this.handle);
}
I read alot about marshalling the last few days, nevertheless I do not get this code working. When my callback function is called (waveIn) when the buffer is full, the hdr structure passed back in wavehdr is obviously corrupted. Here is an examlpe of how the structure looks like at that point:
- wavehdr {WinMM.WinMM.WAVEHDR} WinMM.WinMM.WAVEHDR
dwBufferLength 0x19904c00 uint
dwBytesRecorded 0x0000fa00 uint
dwFlags 0x00000003 uint
dwLoops 0x1990f6a4 uint
+ dwUser 0x00000000 System.IntPtr
+ lpData 0x00000000 System.IntPtr
+ lpNext 0x00000000 System.IntPtr
+ reserved 0x7c07c9a0 System.IntPtr
This obiously is not what I expected to get passed. I am clearly concerned about the order of the fields in the view. I do not know if Visual Studio .NET cares about actual memory order when displaying the record in the "local"-view, but they are obviously not displayed in the order I speciefied in the struct.
Then theres no data pointer and the bufferLength field is far to high. Interestingly the bytesRecorded field is exactly 64000 - bufferLength and bytesRecorded I'd expect both to be 64000 though. I do not know what exactly is going wrong, maybe someone can help me out on this. I'm an absolute noob to managed code programming and marshalling so please don't be too harsh to me for all the stupid things I've propably done.
Oh here's the C code definition for WAVEHDR which I found here, I believe I might have done something wrong in the C# struct definition:
/* wave data block header */
typedef struct wavehdr_tag {
LPSTR lpData; /* pointer to locked data buffer */
DWORD dwBufferLength; /* length of data buffer */
DWORD dwBytesRecorded; /* used for input only */
DWORD_PTR dwUser; /* for client's use */
DWORD dwFlags; /* assorted flags (see defines) */
DWORD dwLoops; /* loop control counter */
struct wavehdr_tag FAR *lpNext; /* reserved for driver */
DWORD_PTR reserved; /* reserved for driver */
} WAVEHDR, *PWAVEHDR, NEAR *NPWAVEHDR, FAR *LPWAVEHDR;
If you are used to work with all those low level tools like pointer-arithmetic, casts, etc starting writing managed code is a pain in the ass. It's like trying to learn how to swim with your hands tied on your back.
Some things I tried (to no effect):
.NET compact framework does not seem to support the Pack = 2^x directive in [StructLayout].
I tried [StructLayout(LayoutKind.Explicit)] and used 4 bytes and 8 bytes alignment. 4 bytes alignmentgave me the same result as the above code and 8 bytes alignment only made things worse - but that's what I expected.
Interestingly if I move the code from setupBuffer into the setupWaveIn and do not declare the GCHandle in the context of the class but in a local context of setupWaveIn the struct returned by the callback function does not seem to be corrupted. I am not sure however why this is the case and how I can use this knowledge to fix my code.
I'd really appreciate any good links on marshalling, calling unmanaged code from C#, etc. Then I'd be very happy if someone could point out my mistakes. What am I doing wrong? Why do I not get what I'd expect.
Android Code Style Guide defines "Android Code Style Rules".
To conform to these rules one have to change quite a number of settings of the Java Code Formatter (Window-Preferences-Java-Formatter) default profile (in Eclipse IDE).
Did anyone managed to configure the formatter to follow the "Android Code Style Rules" already?
If yes, please export the Formatter profile and publish to be used by community.
PS: I've tried to do this myself but I've found that there are too many formatter options available, and most of them are not mentioned in the Code Style Guide :-(
I'd like to be able to compile a C++ library so that it runs within a managed runtime in the CLR. There are several tools for doing this with the JVM (NestedVM, LLJVM, etc) but I can't seem to find any for the CLR. Has anyone tried doing this?
I realise it is possible to create a crosstab within sqlite, but is it possible to dynamically determine the relevant categories/columns at runtime rather than hardcoding them?
Given the following example, it can get rather tedious ...
SELECT
shop_id,
sum(CASE WHEN product = 'Fiesta' THEN units END) as Fiesta,
sum(CASE WHEN product = 'Focus' THEN units END) as Focus,
sum(CASE WHEN product = 'Puma' THEN units END) as Puma,
sum(units) AS total
FROM sales
GROUP BY shop_id
I managed to do this in SQLServer in a stored proceedure before and wondered if there was anything equivalent.
Trying to save the next guy/gal some trouble in finding out what is needed to setup lava lamps or traffic lights or what have you (the term I believe is eXtreme Feedback Devices) as a BIG VISIBLE INDICATOR of your continuous integration build status.
Ensure your post includes... (and please don't mess this question up with imaginative responses.. although it may be insanely funny at the point of conception)
the XFD
what 'helper' hardware is needed
software that you managed to hook it up with
detailed instructions on how to set it up
Is it possible to detect all the hotkeys registered by the OS as well as software applications currently running? Any native or managed approach on the Windows platform? I know that the RegisterHotKey function returns false if the hotkey is already registered, but what I am looking for is an approach, method, etc. that will give me a list of registered hotkeys. Looping all possible combinations with RegisterHotKey does not sound like a good idea. Anything more efficient?
Has anyone managed to develop Android Applications using Eclipse on the Windows platform. I understand the ADB needs to recognise specific models of phone and wondered if the Tattoo is supported.
thanks
Mark
Hi,
I'm developing a printing service on android. I've already managed to handle PostScript and now I would like to know if there is someone out there how knows where to find information about how to write a converter that converts a jpg to a pcl file.
I'm aware of ImageMagic, GostScript etc. but I need to write one on my own.
Thanks,
Andreas
First, I would like to say I'm not an image processing specialist.
I would like to convert image colorspace from one to another, and change icc color profile at the same time. I managed to do it using JMagick (the ImageMagick Java port), but no way in pure Java (even using JAI).
I was reading the C# entry on Wikipedia, and came across:
Managed memory cannot be explicitly freed; instead, it is automatically garbage collected.
Why is it that in languages with automatic memory management, manual management isn't even allowed? I can see that in most cases it wouldn't be necessary, but wouldn't it come in handy where you are tight on memory and don't want to rely on the GC being smart?
I've seen cool C64 demos showing sprites in the border area of the screen. It shouldn't be possible; I think they managed to fool the graphics chip somehow... How exactly did they do it?