473,513 Members | 3,621 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

next page loading too quickly?

Hi,
I'm having trouble when I leave a tabpage to go on to the next. On Focus
Leave, I take a snapshot of that tab. It usually turns out ok, but often,
part of the next tabpage will appear in this snapshot (an outline of a
picturebox or textbox). Is there anything I can do about this?
Thanks!!!!
Mel
Nov 17 '05 #1
3 1431
Mel,

Are you using .NET 2.0? If so, I would hook into the Deselecting event
on the TabControl and then capture your snapshot then (before the tab
switches).

If not, then I would derive from the TabControl class and override the
WndProc method. Look for the WM_NOTIFY message, and then check for the
TCN_SELCHANGING message in the NMHDR structure passed in the lParam
parameter.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"melanieab" <me*******@discussions.microsoft.com> wrote in message
news:DB**********************************@microsof t.com...
Hi,
I'm having trouble when I leave a tabpage to go on to the next. On Focus
Leave, I take a snapshot of that tab. It usually turns out ok, but often,
part of the next tabpage will appear in this snapshot (an outline of a
picturebox or textbox). Is there anything I can do about this?
Thanks!!!!
Mel

Nov 17 '05 #2
Hi again,
I'm not using 2.0 so I'll try the second thing you suggest. Thanks!
Mel

"Nicholas Paldino [.NET/C# MVP]" wrote:
Mel,

Are you using .NET 2.0? If so, I would hook into the Deselecting event
on the TabControl and then capture your snapshot then (before the tab
switches).

If not, then I would derive from the TabControl class and override the
WndProc method. Look for the WM_NOTIFY message, and then check for the
TCN_SELCHANGING message in the NMHDR structure passed in the lParam
parameter.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"melanieab" <me*******@discussions.microsoft.com> wrote in message
news:DB**********************************@microsof t.com...
Hi,
I'm having trouble when I leave a tabpage to go on to the next. On Focus
Leave, I take a snapshot of that tab. It usually turns out ok, but often,
part of the next tabpage will appear in this snapshot (an outline of a
picturebox or textbox). Is there anything I can do about this?
Thanks!!!!
Mel


Nov 17 '05 #3
Hi,

I need to call the following dll(source + header) from my c# code.
further i want to do each operationin this dll by clicking a button.
i would really appreciate all the help in this regard...


/*--------------------Header
File-------------------------------------------------------*/

#ifndef _A664IO_DRIVER_
#define _A664IO_DRIVER_

/*================================================= =============================
== Macros
================================================== ============================*/
#ifdef WIN32
#define DllExport __declspec( dllexport )
#else
#define DllExport
#endif

/*================================================= =============================
== Types
================================================== ============================*/
typedef void * BOARD_HDL; // Handle to a board. Opaque because
different
// vendors require different structures

typedef void * PORT_HDL; // Handle to a port. Opaque because
different
// vendors require different structures

typedef enum
{
LINK_AUTO,
LINK_10MBPS,
LINK_100MBPS

}LINK_SPEED;

typedef enum
{
TX,
RX
}DIRECTION;

typedef enum // Command/function validity matrix: Board |
ES | VL | Port | Log
{
//---------------------------------------------------------------
STOP, // X |
X | X | X | X
START, // X |
X | X | X |
START_LOG_IN_NORMAL, // |
| | | X
START_LOG_LINK_DROPS, // |
| | | X
START_LOG_IC_DROPS, // |
| | | X
START_LOG_RM_DROPS, // |
| | | X
START_LOG_IP_DROPS, // |
| | | X
START_LOG_PROTO_DROPS, // |
| | | X
START_LOG_OUT, // |
| | | X
START_LOG_ALL // |
| | | X
// X: Command valid for function
}CONTROL;

typedef enum
{
API_FAILURE,
API_SUCCESS
}API_STATUS;

/*================================================= =============================
== Manage API Internal Objects
================================================== ============================*/
DllExport
void Open_API( void );

DllExport
void Close_API( void );

/*================================================= =============================
== Load the configuration file
================================================== ============================*/
DllExport
BOARD_HDL Init_Board( char * File_Name,
unsigned int Group_ID,
unsigned int Board_ID,
unsigned int PC_Num,
LINK_SPEED Link_Speed );
/*================================================= =============================
== Obtain access to a port previously defined during configuration file
load
================================================== ============================*/
DllExport
PORT_HDL Connect_Port( BOARD_HDL Board,
unsigned short ES_ID,
unsigned char Partition_ID,
char * Port_Name,
unsigned int Timeout,
DIRECTION Direction );

#if 0

/*================================================= =============================
== Obtain access to a port previously defined during configuration
file load

================================================== ============================*/
DllExport
PORT_HDL Connect_Port( BOARD_HDL Board,
unsigned int Port_unique_ID,
unsigned int Flags,
unsigned int Timeout,
unsigned int Direction);
#endif
/*================================================= =============================
== Activate / De-activate a
== - Board
== - End System
== - Partition
== - Virtual Link
== - Port
== - Traffic Logging
================================================== ============================*/
DllExport
API_STATUS Control_Board( BOARD_HDL Board,
CONTROL Ctrl );

DllExport
API_STATUS Control_ES( BOARD_HDL Board,
unsigned int ES_ID,
CONTROL Ctrl );

DllExport
API_STATUS Control_Partition( BOARD_HDL Board,
unsigned int ES_ID,
unsigned char Partition_ID,
CONTROL Ctrl );

DllExport
API_STATUS Control_VL( BOARD_HDL Board,
unsigned short VL_ID,
CONTROL Ctrl );

DllExport
API_STATUS Control_Port( BOARD_HDL Board,
PORT_HDL Port,
CONTROL Ctrl );

DllExport
API_STATUS Control_Log( BOARD_HDL Board,
CONTROL Ctrl,
char * Filter,
char * File_Name );

/*================================================= =============================
== Refresh a sampling port or
== Transmit a new message in queuing port
================================================== ============================*/
DllExport
API_STATUS Transmit( BOARD_HDL Board,
PORT_HDL Port,
char * Payload,
unsigned int * Size );

/*================================================= =============================
== Obtain latest a sampling message or
== Received last queuing message
================================================== ============================*/
DllExport
API_STATUS Receive( BOARD_HDL Board,
PORT_HDL Port,
char * Payload,
unsigned int * Size );

/*================================================= =============================
== Obtain a string containing statistic counters
================================================== ============================*/
DllExport
API_STATUS Get_Stats_Str( BOARD_HDL Board,
unsigned short VL_ID,
PORT_HDL Port,
char * Stats_Str );

/*================================================= =============================
== Release a port or a board
================================================== ============================*/
DllExport
API_STATUS Close_Port( PORT_HDL Port );

DllExport
API_STATUS Close_Board( BOARD_HDL Board );

/*================================================= =============================
== Execute command string
================================================== ============================*/
DllExport
API_STATUS Execute( char * Cmd_Str );

#endif

/*------------------Source
file------------------------------------------------*/
/*================================================= =============================
== Includes
================================================== ============================*/
#include <math.h>
#include < stdio.h>
#include "A664IO_Driver.h"
#include "cfdx.h"

/*================================================= =============================
== Internal Type Definitions
================================================== ============================*/
typedef struct
{
cfdx_t * Handle;

}BOARD_TYPE;

typedef struct
{
pdesc_t * Handle;
u_int32 Unique_ID;

}PORT_TYPE;

/*================================================= =============================
== Internal Global Data
================================================== ============================*/
// None

/*================================================= =============================
== Error_Callback
================================================== ============================*/
void Error_Callback( char * ebuf,
void * user_param )
{
printf( "Error on board %i\n", *(unsigned int*)user_param );
printf( "%s\n", ebuf );

return;
}

/*================================================= =============================
== Init_API
================================================== ============================*/
void Open_API( void )
{
return;
}

/*================================================= =============================
== Init_Card
================================================== ============================*/
BOARD_HDL Init_Board( char * File_Name,
unsigned int Group_ID,
unsigned int Board_ID,
unsigned int PC_Num,
LINK_SPEED Link_Speed )
{
int32 CFDX_Status = CFDX_FAILURE;
u_int8 * Config_Buffer = NULL;
u_int32 Buffer_Size = 0;
cfdx_t * Handle = NULL;
BOARD_TYPE * Board = NULL;
char Error_Buffer[CFDX_ERRBUF_SIZE];
u_int32 Option_Code = 0;
u_int32 Option_Value = 0;
u_int32 Option_Size = 0;
/*---------------------------------------------------------------------------
-- Load XML file in memory

---------------------------------------------------------------------------*/
CFDX_Status = cfdxcfg_load_buffer_from_file( File_Name,
Config_Buffer,
&Buffer_Size,
Error_Buffer );

Config_Buffer = (u_int8 *) malloc( Buffer_Size * sizeof(u_int8) );

CFDX_Status = cfdxcfg_load_buffer_from_file( File_Name,
Config_Buffer,
&Buffer_Size,
Error_Buffer );

if( CFDX_Status != CFDX_SUCCESS )
{
printf( "cfdxcfg_load_buffer_from_file(): %s\n", Error_Buffer );
return NULL;
}
/*---------------------------------------------------------------------------
-- Load configuration buffer into the driver

---------------------------------------------------------------------------*/
Handle = cfdx_open_board( Config_Buffer,
Buffer_Size,
Group_ID,
Board_ID,
CFDX_OPEN_MINIMIZE_LATENCY,
Error_Callback,
&Board_ID,
Error_Buffer );

if( Handle == NULL )
{
printf( "cfdx_open_board(): %s\n", Error_Buffer );
return NULL;
}
/*---------------------------------------------------------------------------
-- Set link type and speed

---------------------------------------------------------------------------*/
switch( Link_Speed )
{
case LINK_AUTO:
{
Option_Code = CFDX_ENABLE_AUTONEGOTIATION;
Option_Value = 0;
Option_Size = 0;
break;
}

case LINK_10MBPS:
{
Option_Code = CFDX_SET_LINKSPEED;
Option_Value = 10;
Option_Size = sizeof(Option_Value);
break;
}

case LINK_100MBPS:
{
Option_Code = CFDX_SET_LINKSPEED;
Option_Value = 100;
Option_Size = sizeof(Option_Value);
break;
}

default:
{
printf( "Init_Card(): Invalid link speed\n" );
}
}

CFDX_Status = cfdx_set_option( Handle,
ADAPTER_A,
Option_Code,
&Option_Value,
Option_Size );

if( CFDX_Status != CFDX_SUCCESS )
{
sprintf( Error_Buffer, "cfdx_set_option(): %s\n",
cfdx_get_last_error( Handle) );
return NULL;
}

CFDX_Status = cfdx_set_option( Handle,
ADAPTER_B,
Option_Code,
&Option_Value,
Option_Size );

if( CFDX_Status != CFDX_SUCCESS )
{
sprintf( Error_Buffer, "cfdx_set_option(): %s\n",
cfdx_get_last_error( Handle) );
return NULL;
}
/*---------------------------------------------------------------------------
-- Board successfuly initialized, return handle via opaque structure

---------------------------------------------------------------------------*/
Board = malloc( sizeof(BOARD_TYPE) );
Board->Handle = Handle;
/*---------------------------------------------------------------------------
-- The config buffer is not needed anymore

---------------------------------------------------------------------------*/
free( Config_Buffer );

return Board;
}

/*---------------------------------------------------------------------------
-- Convert Unique_ID to Handle

---------------------------------------------------------------------------*/
if( Unique_ID == 0 )
{
printf( "cfdx_get_port_unique_id():%s\n", cfdx_get_last_error(
B->Handle ) );
return NULL;
}
else
{
Handle = cfdx_open_port( B->Handle, Unique_ID, 0, 0 );

if( Handle == NULL )
{
printf( "cfdx_open_port(): %s\n", cfdx_get_last_error(
B->Handle ) );
return NULL;
}
}
/*---------------------------------------------------------------------------
-- Operation completed successfuly
-- -return handle and unique ID via opaque structure

---------------------------------------------------------------------------*/
Port = malloc( sizeof( PORT_TYPE ) );
Port->Handle = Handle;
Port->Unique_ID = Unique_ID;

return Port;
}

#if 0
/*================================================= =============================
== Connect_Port

================================================== ============================*/
PORT_HDL Connect_Port( BOARD_HDL Board,
unsigned int Port_unique_ID,
unsigned int Flags,
unsigned int Timeout,
unsigned int Direction)
{
BOARD_TYPE * B = Board;
pdesc_t * Handle = NULL;
PORT_TYPE * Port = NULL;
u_int32 Unique_ID = 0;

Handle = cfdx_open_port( B->Handle, Port_unique_ID, Flags, Timeout
);

if( Handle == NULL )
{
printf( "cfdx_open_port(): %s\n", cfdx_get_last_error(
B->Handle ) );
return NULL;
}
/*---------------------------------------------------------------------------
-- Operation completed successfuly
-- -return handle and unique ID via opaque structure

---------------------------------------------------------------------------*/
Port = malloc( sizeof( PORT_TYPE ) );
Port->Handle = Handle;
Port->Unique_ID = Unique_ID;

return Port;
}

#endif
/*================================================= =============================
== Transmit
================================================== ============================*/
API_STATUS Transmit( BOARD_HDL Board,
PORT_HDL Port,
char * Payload,
unsigned int * Size )
{
int32 CFDX_Status = CFDX_FAILURE;
BOARD_TYPE * B = Board;
PORT_TYPE * P = Port;
char Error_Buffer[CFDX_ERRBUF_SIZE];

CFDX_Status = cfdx_send_msg( P->Handle,
Payload,
Size,
NULL );

if( CFDX_Status != CFDX_SUCCESS )
{
printf( "cfdx_send_msg():%s\n", cfdx_get_last_error( B->Handle )
);
sprintf( Error_Buffer, "cfdx_send_msg():%s\n",
cfdx_get_last_error( B->Handle ) );
return API_FAILURE;
}

return API_SUCCESS;
}

/*================================================= =============================
== Receive
================================================== ============================*/
API_STATUS Receive( BOARD_HDL Board,
PORT_HDL Port,
char * Payload,
unsigned int * Size )
{
int32 CFDX_Status = CFDX_FAILURE;
BOARD_TYPE * B = Board;
PORT_TYPE * P = Port;
u_int32 Flags;

CFDX_Status = cfdx_recv_msg( P->Handle,
Payload,
Size,
&Flags );

if( CFDX_Status != CFDX_SUCCESS )
{
printf( "cfdx_recv_msg():%s\n", cfdx_get_last_error( B->Handle )
);
return API_FAILURE;
}

return API_SUCCESS;
}

if( CFDX_Status != CFDX_SUCCESS )
{
Status = API_FAILURE;
}

else
{
Status = API_SUCCESS;
}

free(Link_Stats);
free(Proto_Stats);

return Status;
}

/*================================================= =============================
== Close_Port
================================================== ============================*/
API_STATUS Close_Port( PORT_HDL Port )
{
BOARD_TYPE * P = Port;

free( P );

return API_SUCCESS;
}

/*================================================= =============================
== Close_Board
================================================== ============================*/
API_STATUS Close_Board( BOARD_HDL Board )
{
int32 CFDX_Status = CFDX_FAILURE;
BOARD_TYPE * B = Board;

CFDX_Status = cfdx_close_board( B->Handle );

if( CFDX_Status != CFDX_SUCCESS )
{
printf( "Close_Card(): %s\n", cfdx_get_last_error( B->Handle ) );
return API_FAILURE;
}

free( B );
return API_SUCCESS;
}

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4024
by: Wonko | last post by:
Here's my problem if anyone could be so kind to help me out. I assume it's quite easy for an experienced programmer but I'm not one of them :) I have a JavaScript code that: - displays multiple images (+40) in a single image placeholder on ONE page - pre-loads multiple images - on a click of a mouse changes to the next image - on a click...
7
3173
by: Mr B | last post by:
Howdy, I want to set up an Include page in a cell of a table. Then I want to be able to change which page is included on the fly as the user moves the mouse of the various links on the page. How can I do this? THe include page was set up via FrontPage so it put it's Bot stuff in there, but if someone could tell me the "standard" way to...
1
4730
by: tedqn | last post by:
I use the js onKeyup event to trigger server side db searches in a hidden iframe page and generate a list of selectable items in the parent page. The minimum characters to initiate a search is 3. I'm trying to minimize the number of unnecessary db calls as much as I can. It seems like if I type in 6 characters real fast then there's only one...
5
12209
by: John Richardson | last post by:
I've been bothered for some time about my DataGrid not populating my rows very quickly. I have about 10K rows loading into the grid. I create a datatable dt with 2 columns, an ID and a display. The ID is a member of the keys array. I then create a DataView dv over the table, and sort it by Display and ID column (in case of duplicate...
5
2071
by: DCC-700 | last post by:
I am using ASP.Net with VB on the 1.1 Framework running on Win XP Pro. I am trying to gauge the time it takes to sort a datagrid using different code sets. But when I am debugging the page there is a long delay before hitting breakpoint in page load. When I initially load the page I hit the breakpoint right away. Then I click on a Sort...
6
1169
by: MRW | last post by:
I've noticed that some of my pages take a little while to load. So, the page loads from left to right as it comes 'online'. Is there a way of delaying the display until the entire page is ready? Thanks for any help!
5
2802
by: =?Utf-8?B?V2FubmFiZQ==?= | last post by:
We have a page that is loading very slow. There is not a lot of data, not a lot of users are connected at the same time and the page does not produce an error, so I am not sure where to start to look for why it is slowing down. I thought about the DB first and added NOLOCK to a couple of stored procedures that were being run, but with no...
7
2193
by: amishguy | last post by:
Hello, I am having an issue with a site I'm creating right now. I have had this issue before and I would like to figure out what the solution is instead of using workarounds as I have in the past. A little background: I have a php based site. The layout is a table based layout that was generated by slicing a large image. Most of the...
4
2662
by: Nicolas R | last post by:
Hi all, Im trying to figure out how to display a 'loading' message when scripts are being executed, ie when the page is still not ready for interaction. This is for a web app which relies on javascript to insert dom elements and do stuff, so the user must know when everything is ready to interact with. I tried using an interval which...
0
7177
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7394
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7559
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7123
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5100
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4756
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3248
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
1611
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
470
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.