error C3121: cannot change GUID for class 'GeoPoint' - visual-studio-2010

Error messages on build/re-build
e:\aaamac\aaamac\aaamacmprod\debug\jjjjgeo.tlh(1220): error C3121: cannot change GUID for class 'GeoPoint'
e:\aaamac\aaamac\aaamacmprod\debug\jjjjmap.tlh(488) : see declaration of 'GeoPoint'
click on the top line took me to a line in a file "aaaageo.tlh
struct __declspec(uuid("c0f74d34-2802-11d4-a320-006008bf4bdf"))
GeoPoint;
// [ default ] interface IGeoPoint
click on the bottom line took me to a line in a file "aaaamap.tlh"
struct __declspec(uuid("dd0257b9-5c91-473e-8203-bd472f51c44b"))
GeoPoint
{
double lat;
double lon;
};
aaaageo.tlh and aaaamap.tlh are generated codes from tlb files that I have no control over.
This code compiled, built, and ran using VC++ 6.
This code failed to compile/build using nVS2010.
What goes wrong? The tlh files are generated automatically so I cannot remove one of the GeoPoint entries using an editor.

Related

Why there is no autocomplete from Intellisens?

Trying a C++ example with VS 2017 and Unreal I saw in the video once the instructor type ->GetF the intellisense appear but with me it does not so why is that ? I am getting also a red line error under the word GetWorld() "pointer to incomplete class type is not allowed" but the code compile fine !!
void UOpenDoor::BeginPlay()
{
Super::BeginPlay();
ActorThatOpen = GetWorld()->GetFirstPlayerController()->GetPawn();
}

Vala error "unknown type name" using enum from camel

I am writing this code in Vala, using Camel
using Camel;
[...]
MimeParser par = new MimeParser();
[...]
par.push_state( MimeParserState.MULTIPART, boundary );
I downloaded the camel-1.2.vapi from github vala-girs (this link), put it in a vapi subdirectory and compiled with
valac --vapidir=vapi --includedir=/usr/include/evolution-data-server/camel --pkg camel-1.2 --pkg posix --target-glib=2.32 -o prog prog.vala -X -lcamel-1.2
Compiling I get this error:
error: unknown type name "CamelMimeParserState"
const gchar* camel_mime_parser_state_to_string (CamelMimeParserState self);
Looking the C output code I see that the CamelMimeParserState type is used several times but it is never defined. It should be a simple enum because the camel-1.2.vapi file says:
[CCode (cheader_filename = "camel/camel.h", cprefix = "CAMEL_MIME_PARSER_STATE_", has_type_id = false)]
public enum MimeParserState {
INITIAL,
PRE_FROM,
FROM,
HEADER,
BODY,
MULTIPART,
MESSAGE,
PART,
END,
EOF,
PRE_FROM_END,
FROM_END,
HEADER_END,
BODY_END,
MULTIPART_END,
MESSAGE_END
}
So why doesn't the C output code simply use an enum as the vapi file says (described by cprefix CAMEL_MIME_PARSER_STATE_)?
Is there an error in the .vapi file?
I found the solution. The vapi file is wrong because the cname field is missing. Changing the vapi file adding this cname="camel_mime_parser_state_t":
[CCode (cheader_filename = "camel/camel.h", cname="camel_mime_parser_state_t", cprefix = "CAMEL_MIME_PARSER_STATE_", has_type_id = false)]
public enum MimeParserState {
INITIAL,
[...]
works correctly.

tcpdf with laravel 5

i want to save the output pdf file to public folder my method is
public function qrSVG()
{
$qrCodes = ['4659284fff','465928447','465928447','613271980','484016586','aaaaabbbbbccccc'];
$id = ['201596400-1','201596400-2','201596400-3','831070646','493130428','aaaaabbbb'];
PDF::SetTitle('qrcodes\test');
$i=0;
foreach(array_chunk($qrCodes, 2) as $qrCodee)
{
PDF::AddPage();
$m = 55;
$n = 30;
foreach($qrCodee as $qr)
{
QrCode::size(400);
QrCode::margin(3);
QrCode::errorCorrection('H');
QrCode::encoding('UTF-8');
QrCode::backgroundColor(255,255,255);
QrCode::color(0,0,0);
QrCode::imageTitle($id[$i]);
$svg = QrCode::generate($qr);
PDF::ImageSVG('#'.$svg, $x=$m, $y=$n, $w='100', $h='100', $link='', $align='', $palign='', $border=1, $fitonpage=false);
$i++;
$n = 150;
}
}
ob_clean();
PDF::Output('qrcodes\test.pdf');}
this code generate and open the file put don't save it when i replace the last line in my code with PDF::Output('qrcodes\test.pdf', 'F');
when i put any option with PDF::Output there is an error with F and D options the error when use F is
ErrorException in tcpdf_static.php line 2440:
fopen(): remote host file access not supported, file://qrcodes\test.pdf
and when i replace the last line with
PDF::Output($_SERVER['DOCUMENT_ROOT'] . 'qrcodes\test.pdf', 'F');
the error is
ErrorException in tcpdf.php line 2793:
Undefined property: Elibyy\TCPDF\Pdf::$h
The main reason you're getting the error about remote host file access not supported is because you need to provide the full path in the file name that you provide to the Output() method. Yeah, it's a bit annoying and it catches me out all the time!
I can't comment on the second error you're getting because I cannot get your code to run (missing methods in QrCode class). What version are you using? Also, why are you trying to create an SVG for the QR code and then adding that to the PDF? Instead of taking that approach, I would highly recommend following the approach illustrated in this example:
https://github.com/tecnickcom/TCPDF/blob/master/examples/example_050.php
As you will see in the example, you should create an instance of the TCPDF class and then work with that instance, rather than calling the static methods.

Appending a byte into a byte array in Java Card

I have a method below to insert a single byte into a byte buffer and during building and cleaning for a Java Card CAP file it throws an error.
Code:
private void appendOutputBuffer(byte msg) {
ArrayLogic.arrayCopyRepack(msg, (short) 0, (short) 0, outputBuffer, (short) outputBuffer.length);
}
Error:
error: line 163: sctest: class java.lang.Byte not found in export file lang.exp.
error: line 163: sctest: method valueOf(byte) of class java.lang.Byte not found in export file lang.exp or the method signature has changed.
error: line 163: sctest: class java.lang.Byte not found in export file lang.exp.
error: line 163: sctest: class java.lang.Byte in return type of method java.lang.Byte.valueOf(byte) not found.
How do I resolve it ?
This is not how arrayCopyRepack works. Read the documentation: http://www.win.tue.nl/pinpasjc/docs/apis/jc222/javacardx/framework/util/ArrayLogic.html#arrayCopyRepack%28java.lang.Object,%20short,%20short,%20java.lang.Object,%20short%29
Its signature is:
public static final short arrayCopyRepack(Object src,
short srcOff,
short srcLen,
Object dest,
short destOff)
but the src argument is meant to be an array - it is an Object just because there is no common ancestor class for all primitive arrays in Java Card. Not everything in Java Card is an Object: byte is a primitive. That causes your troubles.
The first step of Java Card build is a common Java compiler creating a standard .class file. This compiler does not know anything about Java Card and it sees a byte used as an Object, so it uses autoboxing, casting your byte to java.lang.Byte and adding a dependence to java.lang.Byte in your .class file. So far so good. This is just plain Java, so it works.
However, in Java Card libraries there is no java.lang.Byte in java.lang package. That causes the error when creating a .cap file.
Appending a byte to an existing array (and thus creating a new array) is a very bad idea, btw. You should create your buffer long enough and store the effective length (how long is the used part of the buffer):
private static final short BUF_LEN = (short) 256;
byte[] outputBuffer = new byte[BUF_LEN];
...
private void appendOutputBuffer(byte msg) {
if (effectiveLen == BUF_LEN)
ISOException.throwIt(ISO7816.SW_UNKNOWN);
outputBuffer[effectiveLen] = msg;
++effectiveLen;
}
and think about RAM vs EEPROM storing of both outputBuffer and effectiveLen.

Acceleo java wrapping service doesn't take complex parameter - Invalid result for expression self.invoke

I can't call a java wrapping service in Acceleo because it doesn't recognize parameters type. This is my simple test code: the main calls a query stored in Services.mtl, that calls the java service that just return the name of an object "Send"
Main.mtl
[file ('system.P', false, 'UTF-8')]
[for (t : Send | aSystemBehavior.transitions)) ]
[getName(t)/]
[/for]
[/file]
Services.mtl
[query public getName(arg0 : Send) : String
= invoke('myPackage.Services', 'getName(myPackage.Send)', Sequence{arg0})
/]
Services.java
public class Services
{
public String getName(Send t)
{return t.getName();}
}
The Error Log shows:
Invalid result for expression
self.invoke('myPakage.Services',
'getName(myPakage.Send)', Sequence {arg0}) at line 0 in
Module services for query getName(Send). Last recorded value of self
was org.eclipse.emf.ecore.impl.DynamicEObjectImpl#1f00eb36 (eClass:
org.eclipse.emf.ecore.impl.EClassImpl#2c2aade3 (name: Send)
(instanceClassName: null) (abstract: false, interface: false)).
Problem found while generating the file system.P'.
If I use a String as parameter type instead of Send, everything works fine.
Does the package containing the service "Services" has been exported? If not, open the file MANIFEST.MF, go in the runtime tab and add its package to the list of exported packages. Are you sure that your "Send" object has a name? This message only indicates that null was returned by the query getName.
I don't have anymore this problem... I created a new Acceleo project from scratch, and it works. I am not sure what was the problem... maybe it's something about che choice of metamodels to import during the creation of the Module (I have to choose between run-tim and develop-time metamodel).

Resources