Click here to Skip to main content
15,904,348 members
Home / Discussions / C#
   

C#

 
AnswerRe: DatagridView Adds Extra Empty Row Pin
PIEBALDconsult20-Dec-11 4:27
mvePIEBALDconsult20-Dec-11 4:27 
Questionapp working in window Xp but not in window 7 Pin
Hum Dum19-Dec-11 22:44
Hum Dum19-Dec-11 22:44 
AnswerRe: app working in window Xp but not in window 7 Pin
OriginalGriff19-Dec-11 23:03
mveOriginalGriff19-Dec-11 23:03 
GeneralRe: app working in window Xp but not in window 7 Pin
Hum Dum19-Dec-11 23:37
Hum Dum19-Dec-11 23:37 
AnswerRe: app working in window Xp but not in window 7 Pin
Luc Pattyn20-Dec-11 7:03
sitebuilderLuc Pattyn20-Dec-11 7:03 
GeneralRe: app working in window Xp but not in window 7 Pin
Hum Dum8-Jan-12 22:43
Hum Dum8-Jan-12 22:43 
AnswerRe: app working in window Xp but not in window 7 Pin
Luc Pattyn9-Jan-12 5:17
sitebuilderLuc Pattyn9-Jan-12 5:17 
GeneralRe: app working in window Xp but not in window 7 Pin
Hum Dum9-Jan-12 18:50
Hum Dum9-Jan-12 18:50 
Luc Pattyn wrote:
I can't tell what is wrong in your P/Invoke code as you aren't showing any of it.
The code is same not a bit change from the article i mention i.e. Use PI invoke for serial communication.
Updated code is in download link of article, on MSDN(article) page code is not updated.

In case of not working modem ReceiveThread() of CommBase.cs is not behaving as its in working modem.
C#
eventMask = (uint)Marshal.ReadInt32(uMask);
//some code

//not able to get inside this block in not working modem and OnRxChar(buf[0]) event is not raised
if ((eventMask & Win32Com.EV_RXCHAR) != 0) 
{
	do 
	{
		gotbytes = 0;
		if (!Win32Com.ReadFile(hPort, buf, 1, out gotbytes, unmanagedOv)) 
		{
			int x = Marshal.GetLastWin32Error();
                        throw new CommPortException("IO Error [004]");
		}
		if (gotbytes == 1) OnRxChar(buf[0]);
	} while (gotbytes > 0);
}

//same for OnStatusChange event is not raised
uint i = 0;
if ((eventMask & Win32Com.EV_CTS) != 0) i |= Win32Com.MS_CTS_ON;
if ((eventMask & Win32Com.EV_DSR) != 0) i |= Win32Com.MS_DSR_ON;
if ((eventMask & Win32Com.EV_RLSD) != 0) i |= Win32Com.MS_RLSD_ON;
if ((eventMask & Win32Com.EV_RING) != 0) i |= Win32Com.MS_RING_ON;
if (i != 0)
{
        uint f;
	if (!Win32Com.GetCommModemStatus(hPort, out f)) throw new CommPortException("IO Error [005]");
	OnStatusChange(new ModemStatus(i), new ModemStatus(f));
}

above are few lines of ReceiveThread for reference which are not executing as excepted.


Luc Pattyn wrote:
Your Win7 probably is 64-bit,
Its 32 bit.


Luc Pattyn wrote:
(One way to circumvent this problem is by building for "x86" rather than "AnyCPU").
This i will try. But have doubt as same code is working in same window 7 but with different card.

But not working card respond with .Net 2.0 serial port class under same window 7.
QuestionData Source problem Pin
David baghaturia19-Dec-11 20:13
David baghaturia19-Dec-11 20:13 
AnswerRe: Data Source problem Pin
Jitendra Parida - Jeetu20-Dec-11 1:56
Jitendra Parida - Jeetu20-Dec-11 1:56 
GeneralRe: Data Source problem Pin
David baghaturia20-Dec-11 5:57
David baghaturia20-Dec-11 5:57 
AnswerRe: Data Source problem Pin
AmitGajjar25-Dec-11 22:00
professionalAmitGajjar25-Dec-11 22:00 
GeneralRe: Data Source problem Pin
David baghaturia25-Dec-11 22:46
David baghaturia25-Dec-11 22:46 
QuestionHow to create .chm file that is help file Pin
sarang_k19-Dec-11 17:08
sarang_k19-Dec-11 17:08 
AnswerRe: How to create .chm file that is help file Pin
JF201519-Dec-11 21:17
JF201519-Dec-11 21:17 
AnswerRe: How to create .chm file that is help file Pin
Prasanna Kumar Pete22-Dec-11 0:59
Prasanna Kumar Pete22-Dec-11 0:59 
QuestionAny way to add USER settings at runtime? Pin
SledgeHammer0119-Dec-11 9:59
SledgeHammer0119-Dec-11 9:59 
AnswerRe: Any way to add USER settings at runtime? Pin
fjdiewornncalwe19-Dec-11 10:23
professionalfjdiewornncalwe19-Dec-11 10:23 
GeneralRe: Any way to add USER settings at runtime? Pin
SledgeHammer0119-Dec-11 10:44
SledgeHammer0119-Dec-11 10:44 
Questionhandling network hardwares Pin
Member 825768019-Dec-11 9:52
Member 825768019-Dec-11 9:52 
AnswerRe: handling network hardwares Pin
fjdiewornncalwe19-Dec-11 10:26
professionalfjdiewornncalwe19-Dec-11 10:26 
AnswerRe: handling network hardwares Pin
Subin Mavunkal20-Dec-11 4:32
Subin Mavunkal20-Dec-11 4:32 
QuestionHow to read the SSIS dtsconfig from a c# script Pin
gerom7719-Dec-11 2:30
gerom7719-Dec-11 2:30 
Questionhow to save a recorded macro? Pin
mschotamaster18-Dec-11 3:36
mschotamaster18-Dec-11 3:36 
AnswerRe: how to save a recorded macro? Pin
OriginalGriff18-Dec-11 3:43
mveOriginalGriff18-Dec-11 3:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.