473,511 Members | 16,830 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Undefined Value

31 New Member
Hi,

I have declaring the variable following way in vc++,

BYTE* pTemplate = NULL;

BYTE* pTemp;

When I Trace the "pTemplate" value at runtime which returns "<Undefined Value>".

The same in C# defined,

IntPtr pTemplate
byte[] template = null;
IntPtr pTemp;

what is the problem of defining in vc++?
Aug 28 '07 #1
4 3600
dmjpro
2,476 Top Contributor
Hi,

I have declaring the variable following way in vc++,

BYTE* pTemplate = NULL;

BYTE* pTemp;

When I Trace the "pTemplate" value at runtime which returns "<Undefined Value>".

The same in C# defined,

IntPtr pTemplate
byte[] template = null;
IntPtr pTemp;

what is the problem of defining in vc++?

What is BYTE?
Is that any user defined Data Type?
And please could you give me the whole code so that I can trace it?

Kind regards,
Dmjpro.
Aug 28 '07 #2
krishnasamy
31 New Member
What is BYTE?
Is that any user defined Data Type?
And please could you give me the whole code so that I can trace it?

Kind regards,
Dmjpro.

Hi,
Thanks for your reply.

When i give the definition of that BYTE type i get the following reference in system header file.

typedef unsigned char BYTE;

Its not user defined data type. Its based vc6.0 data type.

Here i given my code.
Expand|Select|Wrap|Line Numbers
  1. BYTE*  pTemplate = NULL;
  2. BYTE* pTemp;
  3. int err = PR2_Ptr(IPhandle, 1, Data, pTemp, size, quality, FALSE, 500, 500);
  4. txt_ChkRet->Text = err.ToString();
  5.  
Aug 28 '07 #3
Banfa
9,065 Recognized Expert Moderator Expert
What does the function PR2_Ptr do?
What does the function PR2_Ptr expect to be passed as arguments?

I suspect the problem is that you pass PR2_Ptr the pTemp parameter which is a NULL pointer, I think you probably need to allocate memory to it first.
Aug 28 '07 #4
krishnasamy
31 New Member
What does the function PR2_Ptr do?
What does the function PR2_Ptr expect to be passed as arguments?

I suspect the problem is that you pass PR2_Ptr the pTemp parameter which is a NULL pointer, I think you probably need to allocate memory to it first.
Thanks for your reply.

PR2_Ptr is a Function Prototype. I declare that below way,

typedef int (CALLBACK* PROC2_IP) ( IDS_HANDLE hHandle, int numFingers, CaptureData pData[], BYTE* &pTemplate, unsigned int &size, unsigned char &quality, bool bQuick, int MaxWidth, int MaxHeight);

HINSTANCE hinstLib_IP;

INIT_IP IP_InitPtr;
PROC2_IP PR2_Ptr;

PR2_Ptr = (PROC2_IP) GetProcAddress(hinstLib_IP, "process2");

if (fRunTimeLinkSuccess = (PR2_Ptr != NULL))
(PR2_Ptr);


int err = PR2_Ptr(IPhandle, 1, Data, pTemplate, size, quality, FALSE, 500, 500);

txt_ChkRet->Text = err.ToString();


I have used above code. How to allocate the memory to pTemplate?

Please suggest me.
Aug 29 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

13
3063
by: Don Vaillancourt | last post by:
What's going on with Javascript. At the beginning there was the "undefined" value which represented an object which really didn't exist then came the null keyword. But yesterday I stumbled...
8
1801
by: Joona I Palaste | last post by:
We all know that this: void *p; if (p=malloc(1)) { free(p); p; } causes undefined behaviour if malloc() succeeds. But what about this?
14
1728
by: ozbear | last post by:
Someone was asking in another forum how to translate: if (x && (y1=(y+y1)/2)) /* all integers with defined values */ to another language. I am at odds with myself as to whether this causes...
1
3095
by: Pavils Jurjans | last post by:
Hello, I am building custom hashtable class, and thinking about value retrieval issues. The thing is, that sometimes the hashtable value may contain value null. If someone is reading this value...
5
3395
by: Steven Prasil | last post by:
I have a C# program with an if statement similar to if (obj.myvar != Undefined.Value) { ...... } When I test it in the CSharp CLR debugger this debugger does not recoginze that the value is...
49
14431
by: matty | last post by:
Hi, I recently got very confused (well that's my life) about the "undefined" value. I looked in the FAQ and didn't see anything about it. On...
17
3324
by: yb | last post by:
Hi, Looking for clarification of undefined variables vs. error in JavaScript code. e.g. <script> alert( z ); // this will be an error, i.e. an exception </script>
45
4763
by: VK | last post by:
(see the post by ASM in the original thread; can be seen at <http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/3716384d8bfa1b0b> as an option) As that is not in relevance to...
13
36863
by: -Lost | last post by:
You can test for an undefined value in two ways: function blah(x) { if (x == undefined) { x = 'default value'; } } That could also have been written: function blah(x)
22
1988
by: blargg | last post by:
Does ~0 yield undefined behavior? C++03 section 5 paragraph 5 seems to suggest so: The description of unary ~ (C++03 section 5.3.1 paragraph 8): But perhaps "one's complement" means the...
0
7242
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7138
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...
1
7081
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...
0
7510
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5066
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...
0
3213
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1576
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 ...
1
781
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
447
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...

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.