maximum lead creation using a web service how to do it? - web-services

I should create in Apex a code for the mass creation of Leads and use as caller of the Workbeanch class. Unfortunately I was able to create the code for the creation of one lead at a time, I saw that you have to use the Wrapper class how is it used?

Related

How do I get information about the Startup Type of a service in c++?

I'm looking for a way to get the Startup type of a service using c++. I am able to get the SERVICE_STATUS data from a ControlService() call, but the data does not include the startup type. I'm aware there is a way to get the Startup Type using windows power shell, maybe I should make a c++ method that makes that power shell call? Is that the best way to do it?
You need to open the service with OpenService() requesting SERVICE_QUERY_CONFIG access, and then you can use QueryServiceConfig(). dwStartType is one of the available fields of the returned QUERY_SERVICE_CONFIG structure data.

N-API Continuous callbacks for c++ media stream

I'm trying to create a node interface for a c++ media player. Upon decoding of a frame, there is an event which allows me to access the frame data, which I'm trying to funnel into node. But I can't seem to figure out how to get that kind of functionality to work with the functions available in the node api. My approach, for the time being, is to figure out a push mechanism to get the data from c++ to javascript where all i need is to initialize a callback in javascript, since it seems more elegant. If that fails I could create a polling loop in js to check if there is new frame data, but it seems less efficient.
I've tried with napi_create_async_work, by creating a lambda function in the execute parameter function, which would allow me to call napi_make_callback for every frame callback, but then I get the following error :
Fatal error in HandleScope::HandleScope
Entering the V8 API without proper locking in place
I'm likely approaching this incorrectly, its the first time I use n-api.
Any help is welcome, thank you!
The issue is mainly pertaining to the fact you can’t access V8 (JavaScript) memory outside the event-loop’s main thread. If you're creating an async thread, by default you're also creating a new memory stack.
Fortunately, a fix is on the way which should allow thread safe access with
napi_create_threadsafe_function (example here)
Until then
There is a header only C++ package which integrates great with the C++ N-API wrapper
Napi-addon-api is update. These is a good way that use the Napi::ThreadSafeFunction.
Doc and example.

In ClrProfiler, how to get managed object from ObjectID

I am building a .Net Profiler for some custom requirement where I need to capture the exception details even though it got handled properly in the code.
To do so-
I have implemented ICorProfilerCallback
SetEventsMask for COR_PRF_MONITOR_EXCEPTIONS
Implemented the ExceptionThrown callback
So far so good, I am getting callback for every exception being thrown. However, it gives OjbectID that is a pointer to the actual exception object. I want more details like the message, call stack, etc. about the exception.
How do I get object details from ObjectID?
As #HansPassant mentioned, what you are doing smells like a debugger feature more than a profiler. However, you can do what you want using the profiler if that is a hard requirement - I believe IL re-writing is possible via the ICorDebug interfaces, but I am a profiler dev and haven't used the debugger interfaces as much.
David Broman's blog has a great description of taking a managed stack walk using the ICorProfilerInfo2 interface. In order to get the native parts you need to do a lot more work.
Navigating the object instance is also done via the ICorProfilerInfo2 interface.
Get the class ID of the object using ICorProfilerInfo::GetClassFromObject()
Using the class ID get the class layout via ICorProfilerInfo2::GetClassLayout()
You will need to parse the object metadata to determine which field you want.
Index into the object to grab the desired data.

Create a new application in ns-2: fail to transmit any packet

I'd like to ask for your help on creating a user-defined application in ns-2.
I tried to create a new application for simulating scheduling policies by modifying the code of CBR traffic application.
I've finished c++ files and tried to do the simulation with the oTcl script. When I run the ns, it turns out that the application does not transmit any packet. To make sure that my Tcl script is correct, I change the application to CBR and then the program can indeed transmit packets.
It seems that the Tcl commands could not access the functions which I define in the c++ domain.
Should I do anything else in the oTcl domain?
I'm wondering if there is anyone who has ever came across the similar situation.
The following are what I've done so far:
Create a new application class in c++ domain.
Create a static shadow object by deriving from TclClass
Create instprocs by defining the function "int command(argc, argv)" in c++ domain.
In oTcl domain: define an instproc init and use -superclass to declare that the new application is a derived class from "Application" class.
Thank you very much for your generous help.

C++ Output: GUI or Console?

I am making an application in C++ that runs a simulation for a health club. The user simply enters the simulation data at the beginning (3 integer values) and presses run. After that there is no user input - so very simple.
After starting the simulation a lot of the logic is deep down in lower classes but a lot of them need to print simple output messages to the UI. Returning a message is not possible as objects need to print to the UI but keep working.
I was going to pass a reference to the UI object to all classes that need it but I end up passing it around quite a lot - there must be a better way.
What I really need is something that can make calling the UI's printOutput(string) function as easy (or not much more difficult) than cout << string;
The UI also has a displayConnectionStatus(bool[] connections) method.
Bear in mind the UI inherits an abstract 'UserInterface' class so simple console UIs and GUIs can be changed in and out easily.
How do you suggest I implement this link to the UI?
If I were to use a global function, how can I redirect it to call methods of the UserInterface implementation that I selected to use?
Don't be afraid of globals.
Global objects hurt encapsulation, but for a targeted solution with no concern for immediate reusability, globals are just fine.
Expose a global object that processes events from your simulation. You can then choose to print the events, send them by e-mail, render them with OpenGL or whatever you fancy. Make a uniform interface that catches what happens inside the simulation via report callbacks, and then you can subclass this global object to suit your needs.
If the object wasn't global, you'd be passing a pointer around all the codebase.
I would suggest to go for logging framework i.e. your own class LogMessages, which got functions which get data and log the data, it can be to a UI, file, over network or anything.
And each class which needs logging, can use your logging class.
This way you can avoid globals and a generic solution , also have a look at http://www.pantheios.org/ which is open source C/C++ Diagnostic Logging API library, you may use that also...