|
You better use decimal instead of double in such circumstances.
|
|
|
|
|
My Oracle SoreProcedue return a table.How Can I get it from c#?
|
|
|
|
|
Hello Friends,
Can anyone tell me how to print a datagrid in a window application using C#. Iam having a very big grid. first it should be shown to a printpreview page and from there it has to be printed. Help me to get the entire grid to a printpreview page.
Vipin
|
|
|
|
|
There is a VB.Net code snippet that does what you want to do here[^] - you should be able to convert it to C# (or compile it and import the compiled class)
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
The article u gave worked.Thank u so much for the information.
Vipin
|
|
|
|
|
|
hi all, i have a windows application built using C# .net 1.1, the application when installed on a pc running English Windows XP runs properly, but when it is installed on a system running Chinese Windows XP it is not displayed properly , the text boxes appear out of place, the images are out of place. Please if anyone knows what the problem could be let me know soon.
Thank you.
From,
Usman Zaheer Jaswal.
|
|
|
|
|
hi
can you please tell me how can I create a local var that doesn't get destroyed after exiting the method?
thanks
|
|
|
|
|
I'm a bit confused by your question, as objects become eligible for garbage collection when no references to them remain in the code.
Could you provide specifics on what exactly you're trying to do? What kind of variable is this, and what do you plan on doing with it when the method returns?
|
|
|
|
|
I am wondering if it's possible to create a variable in a method as follow:
string tttt = "Gggg";
and then after exiting the method i can still access that var
|
|
|
|
|
No, I think!
But, somebody correct me please.
-- modified at 3:38 Friday 21st July, 2006
|
|
|
|
|
Hello,
If I understand you right???
You have to declare your variable inside your Class and not in the Method.
Or you have to store the Value external (Database or XML).
Hope I helped you.
All the best,
Martin
|
|
|
|
|
Hello
One of the main ideas of C# -if not the main- is being managed by the garbage collector. That's why they call it a managed code -while there is an unmanaged code-. This task is quite advanced and is concerned with memory locations. Even then you'd have to store the memory location -otherwise known as pointer- somewhere to access the value.
You still can do something similar to that in C# with reference type only using WeakReference class. Revise it in your MSDN
Yet again what's exactly your point? Sometimes something that's possible is not always the best solution for a matter!! I'm sure there is a better approach to solve your problem -if it's not a mere programming challenge of some sort-
Regards
|
|
|
|
|
Hi friends,
Please tell me while converting C# gridview to excel how to autofit the columns in excel. Please Help Me.
Thanks & Regards
Prya
|
|
|
|
|
As far as I know, you can select all cells in the gridview and Ctrl+C, Ctrl+V them to Excel.
So nothing special there
WM.
What about weapons of mass-construction?
|
|
|
|
|
Hello
aaraaayen wrote: how to autofit the columns in excel
Do you want to do this in the code -ie programmatically- or just like WilliamM told you??
Besides, what does "autofitting" have to do with C# forum?!!
Regards
|
|
|
|
|
i need to do by programmatically.
Prya
|
|
|
|
|
Hello
What do you mean by "autofit columns"? Do you mean resizing the width of the column to fit the content? You want to write an application to do this inside Excel??!! It's quite strange!!!
Also another point. There are many ways to convert the data in a GridView to Exce format. What's your way in doing it? -If you think it's relevant to the issue at hand-
I think I need more details on exactly what you are planning to do. Maybe I could assist you more.
Regards
|
|
|
|
|
Usually I'm using StreamWriter to write the data in CSV file and import it using Excel.
I always use semicolon as delimiter.
|
|
|
|
|
i have a .h file like below.
how can i use it in C#?
//---------------------------------------------------------------
// AVEControl.h: interface for the AVEControl class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_AVECONTROL_H__4E171B4B_A11B_49F1_B41C_5F4A31B5CF08__INCLUDED_)
#define AFX_AVECONTROL_H__4E171B4B_A11B_49F1_B41C_5F4A31B5CF08__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifdef DEVICECONTROL_EXPORTS
#define DEVICECONTROL_API __declspec(dllexport)
#else
#define DEVICECONTROL_API __declspec(dllimport)
#endif
typedef HRESULT (*AVECALLBACK) (PBYTE pbData, LONG lDataLength);
#define E_DEVICE_NOT_READY 0xB0004001L
class DEVICECONTROL_API AVEControl
{
public:
HRESULT StartRecordWithoutPreview(HWND hWndCap, CString FileName, __int64 pFileLength, UINT pFileMessage, BOOL pShowSetting = TRUE);
HRESULT StartRecordWithPreview(HWND hWndCap, RECT rc, CString FileName, __int64 pFileLength, UINT pFileMessage, BOOL pShowSetting = TRUE);
HRESULT StartPreview(HWND hWndCap, RECT rc);
HRESULT SetVideoClippingWindow(HWND hwnd);
HRESULT SetCallback(AVECALLBACK Callback);
HRESULT GetVideoStatus(PUCHAR pSta);
HRESULT SetVideoPosition(LPRECT lpSRCRect, LPRECT lpDSTRect);
void GetCurrentImage(CString BmpFileFullName);
BOOL IsGraphRunning(void);
HRESULT StopGraph(void);
HRESULT ApplySettings(CString IniFileFullName);
HRESULT SetVideoProcAmp(long Property, long Value);
HRESULT GetVideoProcAmp(long Property, long* Value);
HRESULT GetEvent(long* EventCode, LONG_PTR* Param1, LONG_PTR* Param2, long msTimeout);
HRESULT SetNotifyWindow(OAHWND hwnd, long lMsg, LONG_PTR lInstanceData);
HRESULT InitDeviceControl(void);
AVEControl();
virtual ~AVEControl();
};
#endif // !defined(AFX_AVECONTROL_H__4E171B4B_A11B_49F1_B41C_5F4A31B5CF08__INCLUDED_)
|
|
|
|
|
you can try to create a DLL using the C++ class. After creating the DLL it's easier to use in c# with [DllImport] command. In c# char* becomes string byte* becomes byte[] and if you pass a value using reference like in your class "long* Value", use "ref log Value".
Hope it helps
Do your best to be the best
|
|
|
|
|
the Question is not the data type.
We can noticed that a class have been defined as below:
{
class DEVICECONTROL_API AVEControl
}
in the head file,
all the functions is defined in the class.
so if i use [DllImport] to define the function in C#,
when run it, an exception is found ,which message as "EntryPoint can not be found in DLL",
So I think the reason is that we cann't use the class from the unmanaged Dll
directly in C#,we have to build a wrapper use C++.net .
but How?
|
|
|
|
|
i created a c++ dll in .net using a code like this:
extern "C"
{
__declspec(dllexport) <method definition="">
{
//method body
}
__declspec(dllexport) <method definition="">
{
//method body
}
}
try it. maybe it will work for you too!
Do your best to be the best
|
|
|
|
|
thank you for your answer.
but I cann't do it.
because the DLL is already exist.
it was from a video capturer SDK.
the head file is defined as in the article.
and all functions have been defined in a class.
if i use [DlImport],compile is right, but when i run, an exception shown with"can not found the entrypoint from .dll".
i think the trouble is the class defination.
so i want to know how to use the class from the dll.
|
|
|
|
|
When a user right-clicks to open a context menu, most native Win32 apps allow the user to then also right-click on a context menu item to choose it.
I am writing a desktop app using WinForms on .NET 1.1. Unfortunately, System.Windows.Forms.MenuItem's Click event only get raised when the user left-clicks a context menu item. This makes my WinForms app feel clunky compared to native Win32 apps.
Is there a workaround to allow WinForms context menu items to be selected with a right-click?
thanks!
chris
-- modified at 21:07 Thursday 20th July, 2006
|
|
|
|