Label printing with c++

Label printing integration (NiceWatch middleware and ActiveX programming interface)

Moderators: Georges, milos, NiceLabel Support Team

Post Reply
Valued Contributor
Posts: 23
Joined: Fri Jun 04, 2010 11:04 am

Label printing with c++

Post by vision2010 » Wed Jun 15, 2011 2:46 pm

I have to change an old application (written in c++). We want to print the label with nicelabel.
Is it possible to integrate nice label to c++?
Have you any example for c++. I only could find examples for .net and vb.
We want do design the label and fill it with 5 variable via c++ and start the printing automaticlly.
The printer is also variable.

Best regards

NiceLabel Development
NiceLabel Development
Posts: 22
Joined: Wed Nov 29, 2006 2:10 pm

Re: Label printing with c++

Post by primoz » Thu Jun 16, 2011 9:53 am

You can use nicelabel from c++ by adding one of the following lines to your source code:

When working with NiceEngine:

Code: Select all

#import "c:\Program Files (x86)\Common Files\EuroPlus Shared\NiceEngine 5\niceengine5wr.dll" no_namespace named_guids
When working with NiceLabel:

Code: Select all

#import "..path to nice label Bin folder\NiceLabel5WR.dll" no_namespace named_guids
To invoke the NiceLabel interface you can use the following code snippet:

Code: Select all

CoInitialize (NULL);
	INiceAppPtr pNice;
	HRESULT hr = CoCreateInstance(__uuidof(NiceApp), NULL, CLSCTX_INPROC_SERVER, __uuidof(INiceApp), (void**)&pNice);

                INiceLabelPtr pLabel = pOnline->LabelOpenEx("path to label file");

                 //Invoke "label" interface members by calling "pLabel->InterfaceMember" etc.

                //release nicelabel interface
                pNice = NULL;	
	CoUninitialize ();
Hope this helps.

Post Reply