-
Notifications
You must be signed in to change notification settings - Fork 3
/
framework.d
2163 lines (1691 loc) · 44.5 KB
/
framework.d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
framework.d
Translated from framework.c by Laeeth Isharc
Purpose: Framework library for Microsoft Excel.
This library provides some basic functions
that help in writing Excel DLLs. It includes
simple functions for managing memory with XLOPER12s,
creating temporary XLOPER12s, robustly calling
Excel12(), and outputting debugging strings
to the debugger for the current application.
The main purpose of this library is to help
you to write cleaner C code for calling Excel.
For example, using the framework library you
can write
Excel12f(xlcDisplay, 0, 2, TempMissing12(), TempBool12(0));
instead of the more verbose
XLOPER12 xMissing, bool_;
xMissing.xltype = xltypeMissing;
bool_.xltype = xltypeBool;
bool_.val.bool_ = 0;
Excel12(xlcDisplay, 0, 2, (LPXLOPER12) &xMissing, (LPXLOPER12) &bool_);
The library is non-reentrant.
Define _DEBUG to use the debugging functions.
Source code is provided so that you may
enhance this library or optimize it for your
own application.
Platform: Microsoft Windows
Functions:
debugPrintf
GetTempMemory
FreeAllTempMemory
Excel
Excel12f
TempNum
TempNum12
TempStr
TempStrConst
TempStr12
TempBool
TempBool12
TempInt
TempInt12
TempErr
TempErr12
TempActiveRef
TempActiveRef12
TempActiveCell
TempActiveCell12
TempActiveRow
TempActiveRow12
TempActiveColumn
TempActiveColumn12
TempMissing
TempMissing12
InitFramework
QuitFramework
*/
debug=0;
import core.sys.windows.windows;
//import std.c.windows.windows;
import xlcall;
import xlcallcpp;
import core.stdc.string;
import core.stdc.stdlib:malloc,free;
import memorymanager;
import memorypool;
enum rwMaxO8=65536;
enum colMaxO8=256;
enum cchMaxStz=255;
enum MAXSHORTINT =0x7fff;
enum CP_ACP = 0;
enum MAXWORD = 0xFFFF;
// malloc wchar framewrk memorymanager stdarg
static if(false) // debug
{
/**
debugPrintf()
Purpose:
sends a string to the debugger for the current application.
Parameters:
LPSTR lpFormat The format definition string
... The values to print
Returns:
Comments:
*/
void debugPrintf(LPSTR lpFormat, ...) // cdecl
{
char rgch[256];
va_list argList;
va_start(argList,lpFormat);
wvsprintfA(rgch,lpFormat,argList);
va_end(argList);
OutputDebugStringA(rgch);
}
}
/**
GetTempMemory()
Purpose:
Allocates temporary memory. Temporary memory
can only be freed in one chunk, by calling
FreeAllTempMemory(). This is done by Excel12f().
Parameters:
size_t cBytes How many bytes to allocate
Returns:
LPSTR A pointer to the allocated memory,
or 0 if more memory cannot be
allocated. If this fails,
check that MEMORYSIZE is big enough
in MemoryPool.h and that you have
remembered to call FreeAllTempMemory
Comments:
Algorithm:
The memory allocation algorithm is extremely
simple: on each call, allocate the next cBytes
bytes of a static memory buffer. If the buffer
becomes too full, simply fail. To free memory,
simply reset the pointer (vOffsetMemBlock)
back to zero. This memory scheme is very fast
and is optimized for the assumption that the
only thing you are using temporary memory
for is to hold arguments while you call Excel12f().
We rely on the fact that you will free all the
temporary memory at the same time. We also
assume you will not need more memory than
the amount required to hold a few arguments
to Excel12f().
Note that the memory allocation algorithm
now supports multithreaded applications by
giving each unique thread its own static
block of memory. This is handled in the
MemoryManager.cpp file automatically.
*/
//extern(Windows) LPSTR GetTempMemory(size_t cBytes)
extern(Windows) ubyte* GetTempMemory(size_t cBytes)
{
return MGetTempMemory(cBytes);
}
/**
FreeAllTempMemory()
Purpose:
Frees all temporary memory that has been allocated
for the current thread
Parameters:
Returns:
Comments:
*/
extern(Windows) void FreeAllTempMemory()
{
MFreeAllTempMemory();
}
/**
Excel()
Purpose:
A fancy wrapper for the Excel4() function. It also
does the following:
(1) Checks that none of the LPXLOPER arguments are 0,
which would indicate that creating a temporary XLOPER
has failed. In this case, it doesn't call Excel
but it does print a debug message.
(2) If an error occurs while calling Excel,
print a useful debug message.
(3) When done, free all temporary memory.
#1 and #2 require _DEBUG to be defined.
Parameters:
int xlfn Function number (xl...) to call
LPXLOPER pxResult Pointer to a place to stuff the result,
or 0 if you don't care about the result.
int count Number of arguments
... (all LPXLOPERs) - the arguments.
Returns:
A return code (Some of the xlret... values, as defined
in XLCALL.H, OR'ed together).
Comments:
*/
int Excel(int xlfn, LPXLOPER pxResult, LPXLOPER[] args ...) // cdecl
{
int xlret;
xlret = Excel4v(xlfn,pxResult,cast(int)args.length,cast(LPXLOPER *)args.ptr);
static if(false) //debug
{
if (xlret != xlretSuccess)
{
debugPrintf("Error! Excel4(");
if (xlfn & xlCommand)
debugPrintf("xlCommand | ");
if (xlfn & xlSpecial)
debugPrintf("xlSpecial | ");
if (xlfn & xlIntl)
debugPrintf("xlIntl | ");
if (xlfn & xlPrompt)
debugPrintf("xlPrompt | ");
debugPrintf("%u) callback failed:",xlfn & 0x0FFF);
/* More than one error bit may be on */
if (xlret & xlretAbort)
{
debugPrintf(" Macro Halted\r");
}
if (xlret & xlretInvXlfn)
{
debugPrintf(" Invalid Function Number\r");
}
if (xlret & xlretInvCount)
{
debugPrintf(" Invalid Number of Arguments\r");
}
if (xlret & xlretInvXloper)
{
debugPrintf(" Invalid XLOPER\r");
}
if (xlret & xlretStackOvfl)
{
debugPrintf(" Stack Overflow\r");
}
if (xlret & xlretFailed)
{
debugPrintf(" Command failed\r");
}
if (xlret & xlretUncalced)
{
debugPrintf(" Uncalced cell\r");
}
}
} // debug
FreeAllTempMemory();
return xlret;
}
/**
Excel12f()
Purpose:
A fancy wrapper for the Excel12() function. It also
does the following:
(1) Checks that none of the LPXLOPER12 arguments are 0,
which would indicate that creating a temporary XLOPER12
has failed. In this case, it doesn't call Excel12
but it does print a debug message.
(2) If an error occurs while calling Excel12,
print a useful debug message.
(3) When done, free all temporary memory.
#1 and #2 require _DEBUG to be defined.
Parameters:
int xlfn Function number (xl...) to call
LPXLOPER12 pxResult Pointer to a place to stuff the result,
or 0 if you don't care about the result.
int count Number of arguments
... (all LPXLOPER12s) - the arguments.
Returns:
A return code (Some of the xlret... values, as defined
in XLCALL.H, OR'ed together).
Comments:
*/
int Excel12f(int xlfn, LPXLOPER12 pxResult, LPXLOPER12[] args) // cdecl
{
int xlret;
xlret = Excel12v(xlfn,pxResult,cast(int)args.length, cast(LPXLOPER12 *)args.ptr);
static if(false) //debug
{
if (xlret != xlretSuccess)
{
debugPrintf("Error! Excel12(");
if (xlfn & xlCommand)
debugPrintf("xlCommand | ");
if (xlfn & xlSpecial)
debugPrintf("xlSpecial | ");
if (xlfn & xlIntl)
debugPrintf("xlIntl | ");
if (xlfn & xlPrompt)
debugPrintf("xlPrompt | ");
debugPrintf("%u) callback failed:",xlfn & 0x0FFF);
/* More than one error bit may be on */
if (xlret & xlretAbort)
{
debugPrintf(" Macro Halted\r");
}
if (xlret & xlretInvXlfn)
{
debugPrintf(" Invalid Function Number\r");
}
if (xlret & xlretInvCount)
{
debugPrintf(" Invalid Number of Arguments\r");
}
if (xlret & xlretInvXloper)
{
debugPrintf(" Invalid XLOPER12\r");
}
if (xlret & xlretStackOvfl)
{
debugPrintf(" Stack Overflow\r");
}
if (xlret & xlretFailed)
{
debugPrintf(" Command failed\r");
}
if (xlret & xlretUncalced)
{
debugPrintf(" Uncalced cell\r");
}
}
} // debug
FreeAllTempMemory();
return xlret;
}
/**
TempNum()
Purpose:
Creates a temporary numeric (IEEE floating point) XLOPER.
Parameters:
double d The value
Returns:
LPXLOPER The temporary XLOPER, or 0
if GetTempMemory() failed.
Comments:
*/
LPXLOPER TempNum(double d)
{
LPXLOPER lpx;
lpx = cast(LPXLOPER) GetTempMemory(XLOPER.sizeof);
if (!lpx)
{
return null;
}
lpx.xltype = xltypeNum;
lpx.val.num = d;
return lpx;
}
/**
TempNum12()
Purpose:
Creates a temporary numeric (IEEE floating point) XLOPER12.
Parameters:
double d The value
Returns:
LPXLOPER12 The temporary XLOPER12, or 0
if GetTempMemory() failed.
Comments:
*/
LPXLOPER12 TempNum12(double d)
{
LPXLOPER12 lpx;
lpx = cast(LPXLOPER12) GetTempMemory(XLOPER12.sizeof);
if (!lpx)
{
return null;
}
lpx.xltype = xltypeNum;
lpx.val.num = d;
return lpx;
}
/**
TempStr()
Purpose:
Creates a temporary string XLOPER
Parameters:
LPSTR lpstr The string, as a null-terminated
C string, with the first byte
undefined. This function will
count the bytes of the string
and insert that count in the
first byte of lpstr. Excel cannot
handle strings longer than 255
characters.
Returns:
LPXLOPER The temporary XLOPER, or 0
if GetTempMemory() failed.
Comments:
(1) This function has the side effect of inserting
the byte count as the first character of
the created string.
(2) For highest speed, with constant strings,
you may want to manually count the length of
the string before compiling, and then avoid
using this function.
(3) Behavior is undefined for non-null terminated
input or strings longer than 255 characters.
Note: If lpstr passed into TempStr is readonly, TempStr
will crash your XLL as it will try to modify a read only
string in place. strings declared on the stack as described below
are read only by default in VC++
char *str = " I am a string"
Use extreme caution while calling TempStr on such strings. Refer to
VC++ documentation for complier options to ensure that these strings
are compiled as read write or use TempStrConst instead.
TempStr is provided mainly for backwards compatability and use of
TempStrConst is encouraged going forward.
*/
LPXLOPER TempStr(LPSTR lpstr)
{
LPXLOPER lpx;
lpx = cast(LPXLOPER) GetTempMemory(XLOPER.sizeof);
if (!lpx)
{
return null;
}
lpstr[0] = cast(BYTE) strlen (lpstr+1);
lpx.xltype = xltypeStr;
lpx.val.str = lpstr;
return lpx;
}
/**
TempStrConst()
Purpose:
Creates a temporary string XLOPER from a
const string with a local copy in temp memory
Parameters:
LPSTR lpstr The string, as a null-terminated
C string. This function will
count the bytes of the string
and insert that count in the
first byte of the temp string.
Excel cannot handle strings
longer than 255 characters.
Returns:
LPXLOPER The temporary XLOPER, or 0
if GetTempMemory() failed.
Comments:
Will take a string of the form "abc\0" and make a
temp XLOPER of the form "\003abc"
*/
LPXLOPER TempStrConst(const LPSTR lpstr)
{
LPXLOPER lpx;
LPSTR lps;
size_t len;
len = strlen(lpstr);
lpx = cast(LPXLOPER) (GetTempMemory(XLOPER.sizeof) + len+1);
if (!lpx)
{
return null;
}
lps = cast(LPSTR)lpx + XLOPER.sizeof;
lps[0] = cast(BYTE)len;
//can't strcpy_s because of removal of null-termination
memcpy_s( cast(ubyte*)lps+1, cast(uint)len+1, cast(ubyte*)lpstr, cast(uint)len);
lpx.xltype = xltypeStr;
lpx.val.str = lps;
return lpx;
}
/**
TempStr12()
Purpose:
Creates a temporary string XLOPER12 from a
unicode const string with a local copy in
temp memory
Parameters:
wchar lpstr The string, as a null-terminated
unicode string. This function will
count the bytes of the string
and insert that count in the
first byte of the temp string.
Returns:
LPXLOPER12 The temporary XLOPER12, or 0
if GetTempMemory() failed.
Comments:
(1) Fix for const string pointers being passed in to TempStr.
Note it assumes NO leading space
(2) Also note that XLOPER12 now uses unicode for the string
operators
(3) Will remove the null-termination on the string
Note: TempStr12 is different from TempStr and is more like TempStrConst
in its behavior. We have consciously made this choice and deprecated the
behavior of TempStr going forward. Refer to the note in comment section
for TempStr to better understand this design decision.
*/
LPXLOPER12[] TempStr12(wstring[] strings)
{
LPXLOPER12[] ret;
ret.length=strings.length;
foreach(i,str;strings)
ret[i]=strings[i].TempStr12;
return ret;
}
wchar* makePascalString(wchar* str)
{
auto len=lstrlenW(str);
auto lpx=GetTempMemory((len+1)*2);
if (lpx is null)
return null;
auto lps=cast(wchar*)(cast(CHAR*)lpx);
lps[0]=cast(BYTE)len;
wmemcpy_s( lps+1, len+1, str, len);
return lps;
}
LPXLOPER12 TempStr12(wstring lpstr)
{
LPXLOPER12 lpx;
wchar* lps;
int len=cast(int)lpstr.length;
lpx = cast(LPXLOPER12) (GetTempMemory(XLOPER12.sizeof + (len+1)*2));
if (lpx is null)
{
return null;
}
lps = cast(wchar*)((cast(ubyte*)lpx + XLOPER12.sizeof));
lps[0] = cast(wchar)len;
//can't wcscpy_s because of removal of null-termination
wmemcpy_s( lps+1, len+1, lpstr.ptr, len);
lpx.xltype = xltypeStr;
lpx.val.str = lps;
return lpx;
}
LPXLOPER12 TempStr12(const(wchar*) lpstr)
{
LPXLOPER12 lpx;
wchar* lps;
int len;
len = lstrlenW(lpstr);
lpx = cast(LPXLOPER12) (GetTempMemory(XLOPER12.sizeof) + (len+1)*2);
if (!lpx)
{
return null;
}
lps = cast(wchar*)((cast(CHAR*)lpx + XLOPER12.sizeof));
lps[0] = cast(BYTE)len;
//can't wcscpy_s because of removal of null-termination
wmemcpy_s( lps+1, len+1, lpstr, len);
lpx.xltype = xltypeStr;
lpx.val.str = lps;
return lpx;
}
/**
TempBool()
Purpose:
Creates a temporary logical (true/false) XLOPER.
Parameters:
int b 0 - for a false XLOPER
Anything else - for a true XLOPER
Returns:
LPXLOPER The temporary XLOPER, or 0
if GetTempMemory() failed.
Comments:
*/
LPXLOPER TempBool(int b)
{
LPXLOPER lpx;
lpx = cast(LPXLOPER) GetTempMemory(XLOPER.sizeof);
if (!lpx)
{
return null;
}
lpx.xltype = xltypeBool;
lpx.val.bool_ = b?1:0;
return lpx;
}
/**
TempBool12()
Purpose:
Creates a temporary logical (true/false) XLOPER12.
Parameters:
BOOL b 0 - for a false XLOPER12
Anything else - for a true XLOPER12
Returns:
LPXLOPER12 The temporary XLOPER12, or 0
if GetTempMemory() failed.
Comments:
*/
LPXLOPER12 TempBool12(BOOL b)
{
LPXLOPER12 lpx;
lpx = cast(LPXLOPER12) GetTempMemory(XLOPER12.sizeof);
if (!lpx)
{
return cast(LPXLOPER12)0;
}
lpx.xltype = xltypeBool;
lpx.val.bool_ = b?1:0;
return lpx;
}
/**
TempInt()
Purpose:
Creates a temporary integer XLOPER.
Parameters:
short int i The integer
Returns:
LPXLOPER The temporary XLOPER, or 0
if GetTempMemory() failed.
Comments:
*/
LPXLOPER TempInt(short i)
{
LPXLOPER lpx;
lpx = cast(LPXLOPER) GetTempMemory(XLOPER.sizeof);
if (!lpx)
{
return cast(LPXLOPER)0;
}
lpx.xltype = xltypeInt;
lpx.val.w = i;
return lpx;
}
/**
TempInt12()
Purpose:
Creates a temporary integer XLOPER12.
Parameters:
int i The integer
Returns:
LPXLOPER12 The temporary XLOPER12, or 0
if GetTempMemory() failed.
Comments:
Note that the int oper has increased in size from
short int up to int in the 12 opers
*/
LPXLOPER12 TempInt12(int i)
{
LPXLOPER12 lpx;
lpx = cast(LPXLOPER12) GetTempMemory(XLOPER12.sizeof);
if (!lpx)
{
return cast(LPXLOPER12)0;
}
lpx.xltype = xltypeInt;
lpx.val.w = i;
return lpx;
}
/**
TempErr()
Purpose:
Creates a temporary error XLOPER.
Parameters:
WORD err The error code. One of the xlerr...
constants, as defined in XLCALL.H.
See the Excel user manual for
descriptions about the interpretation
of various error codes.
Returns:
LPXLOPER The temporary XLOPER, or 0
if GetTempMemory() failed.
Comments:
*/
LPXLOPER TempErr(WORD err)
{
LPXLOPER lpx;
lpx = cast(LPXLOPER) GetTempMemory(XLOPER.sizeof);
if (!lpx)
{
return null;
}
lpx.xltype = xltypeErr;
lpx.val.err = err;
return lpx;
}
/**
TempErr12()
Purpose:
Creates a temporary error XLOPER12.
Parameters:
int err The error code. One of the xlerr...
constants, as defined in XLCALL.H.
See the Excel user manual for
descriptions about the interpretation
of various error codes.
Returns:
LPXLOPER12 The temporary XLOPER12, or 0
if GetTempMemory() failed.
Comments:
Note the paramater has changed from a WORD to an int
in the new 12 operators
*/
LPXLOPER12 TempErr12(int err)
{
LPXLOPER12 lpx;
lpx = cast(LPXLOPER12) GetTempMemory(XLOPER12.sizeof);
if (!lpx)
{
return null;
}
lpx.xltype = xltypeErr;
lpx.val.err = err;
return lpx;
}
/**
TempActiveRef()
Purpose:
Creates a temporary rectangular reference to the active
sheet. Remember that the active sheet is the sheet that
the user sees in front, not the sheet that is currently
being calculated.
Parameters:
WORD rwFirst (0 based) The first row in the rectangle.
WORD rwLast (0 based) The last row in the rectangle.
BYTE colFirst (0 based) The first column in the rectangle.
BYTE colLast (0 based) The last column in the rectangle.
Returns:
LPXLOPER The temporary XLOPER, or 0
if GetTempMemory() failed.
Comments:
*/
LPXLOPER TempActiveRef(WORD rwFirst, WORD rwLast, BYTE colFirst, BYTE colLast)
{
LPXLOPER lpx;
LPXLMREF lpmref;
int wRet;
lpx = cast(LPXLOPER) GetTempMemory(XLOPER.sizeof);
lpmref = cast(LPXLMREF) GetTempMemory(XLMREF.sizeof);
if (!lpmref)
{
return null;
}
/* calling Excel() instead of Excel4() would free all temp memory! */
wRet = Excel4(xlSheetId, lpx, 0);
if (wRet != xlretSuccess)
{
return null;
}
else
{
lpx.xltype = xltypeRef;
lpx.val.mref.lpmref = lpmref;
lpmref.count = 1;
lpmref.reftbl[0].rwFirst = rwFirst;
lpmref.reftbl[0].rwLast = rwLast;
lpmref.reftbl[0].colFirst = colFirst;
lpmref.reftbl[0].colLast = colLast;
return lpx;
}
}
/**
TempActiveRef12()
Purpose:
Creates a temporary rectangular reference to the active
sheet. Remember that the active sheet is the sheet that