declare

How to call a Delphi DLL from VB6

Given the following Delphil DLL declaration function csd_HandleData(aBuf: PChar; aLen: integer): integer; stdcall; what would be the VB6 declaration to use it? I've tried a variety of declarations, e.g. Declare Function csd_HandleData Lib "chsdet.dll" (ByVal aBuf As String, ByVal aLen As Integer) Declare Function csd_HandleData Lib ...

Defining const values in C

I have a C project where all code is organized in *.c/*.h file pairs, and I need to define a constant value in one file, which will be however also be used in other files. How should I declare and define this value? Should it be as static const ... in the *.h file? As extern const ... in the *.h file and defined in the *.c file? In what...

dojo: inheritance with default value - the mixin doesn't happen...

I wish to declare a new dojo class inheriting from an existing dojo class, but with my own choice of default values for the class's properties. (The user can still override those values.) I am declaring my own version of the dijit.form.FilteringSelect such that: the hasDownArrow property defaults to false (rather than the standard tr...

Is there a strict definition for the words define, declare and assign?

I tend to use the words define, declare and assign interchangeably but this seems to cause offense to some people. Is this justified? Should I only use the word declare for the first time I assign to a variable? Or is there more to it than that? ...

DllImport vs Declare in VB.NET

I notice in the MSDN documentation that there are multiple ways to declare a reference to a function in an external DLL from within a VB.NET program. The confusing thing is that MSDN claims that you can only use the DllImportAttribute class with Shared Function prototypes "in rare cases", but I couldn't find the explanation for this s...

How do i declare and use a C# object in an .ASPX file?

Hey guys, i am making a website using asp.net and C# and well i got stuck at the first hurdle, i found out that to use code you use the <% %> with asp but i dont get how i would create an object of my class to use in the aspx file? I think its syntax more than anything i cant seem to get to work. Thanks, Ash ...

variable-size type declared outside of any function

when declaring the two dimensional array int random[height][width]; and then using it in a function void populate(int random[height][width], int x, int y) gives the error variable-size type declared outside of any function. I know I'm doing something wrong, and that its something small. I just have a bad memory... ...

Where is pow function defined and implemented in C?

I read that the pow(double, double) function is defined in "math.h" but I can't find its declaration. Does anybody know where this function declared? And where is it implemented in C? Reference: http://publications.gbdirect.co.uk/c%5Fbook/chapter9/maths%5Ffunctions.html ...

why a[n] is accepted in c during runtime?

why can we do this in c? int n; scanf("%d",&n); int a[n]; I thought array is located memory during load time but seems like the above example works during runtime. Do I misunderstand any thing? can you guys help? Thanks, ...

how do php's declare(ticks) really work?

i created a signal handling class using pcntl_signal which now i want to use for sigalrm the problem i have is that my phpunit test for testing the signalclass works (where im only using declare ticks in the signalclass), but the testclass for testing the alarm class, which in turn using the signalclass doesnt if i add declare(ticks=1) ...

What went wrong with my Declare statement?

I've recently fixed a bug in a VB6 application, but I'm not sure, what exactly went wrong. The offending part was a wrong API declaration of CreateEvent. This is, what API Viewer generated: Declare Function CreateEvent Lib "kernel32" Alias "CreateEventA" (lpEventAttributes As SECURITY_ATTRIBUTES, ...) As Long The next one is the wro...

Different ways to declare/define variables?

Hello This is a VB.Net newbie question. I'm confused at the different ways to declare and define variables. Here's an example: Dim URL As String = http://www.c-sharpcorner.com/default.asp Dim request As HttpWebRequest = WebRequest.Create(URL) Dim response As HttpWebResponse = request.GetResponse() Dim reader As StreamReader = New Stre...

PHP using Declare ? What is a tick?

Iam a little bit confused by php function declare. What exactly is an single tick, i thought 1 tick = one line of code? But if i use: function myfunc() { print "Tick"; } register_tick_function("myfunc"); declare(ticks=1) { echo 'foo!bar'; } The script prints : "Tick" 2 Times?? ...

How do I declare a pipe in a header file? (In C)

I have an assignment in which I need to declare a pipe in a header file. I really have no idea how to do this. It might be a really stupid question and I might be missing something obvious. If you could point me in the right direction I would greatly appreciate it. Thanks for your time. EDIT: Sorry about the question being so vague. M...

How to get list of declared functions with their data from php file?

I need to get list of functions with their contents (not only the function name) from php file. I tried to use regex but it has lots of limitations. it doesn't parse all types of functions. for example it fails if the function has if and for loop statements. in details: I have around 100 include files. each file has number of declared f...

declaring/initializing primitives equal to creating new objects

is declaring/initializing primitives the same as creating new objects? from what i know when we create primitives, we also creating wrapper classes for them. im implementing on java btw. ...

Why use constants in programming?

I've just been going back over a bit of C studying using Ivor Horton's Beginning C book. I got to the bit about declaring constants which seems to get mixed up with variables in the same sentence. Just to clarify, what is the difference in specifying constants and variables in C, and really, when do you need to use a constant instead of...

How to declare ULARGE_INTEGER in c#?

Based upon this question How to declarate LARGE_INTEGER in C# with answer of: [StructLayout(LayoutKind.Absolute, Size=8)] struct LARGE_INTEGER { [FieldOffset(0)]public Int64 QuadPart; [FieldOffset(0)]public UInt32 LowPart; [FieldOffset(4)]public Int32 HighPart; } Is my assumption below for declaring ULARGE_INTEGER correct?...

SELECT INTO Variable in MySQL DECLARE causes syntax error?

I´d like to SELECT a single value into a variable. I´d tried to following: DECLARE myvar INT(4); -- immediately returns some syntax error. SELECT myvalue FROM mytable WHERE anothervalue = 1; -- returns a single integer SELECT myvalue INTO myvar FROM mytable WHERE anothervalue = 1; -- does not work, also tried @myvar...

Declare and <DllImport> in VB.NET have different results

I've been trying to call a login method of an unmanaged DLL. If I use Declare the login fails. Private Declare Function Login Lib "dllCore" (ByVal lpName As String, ByVal lpPassword As String) As Int32 Login ("Steve", "123456") ' THIS FAILS TO LOGIN ALTHOUGH THE PARAMS ARE CORRECT If I use DllImport, it works !! <DllImport("dll...