Visual C++ :: Convert C# Module Into Unmanaged DLL?
Oct 21, 2014
I am in need to convert some C# code into C++ equivalences. But I don't want to spend the efforts to do so. Is there an handy way to convert an existing code of C# into C++ (unmanaged code)?
View 7 Replies
ADVERTISEMENT
Oct 22, 2014
I know the user installation must involve some registry manipulations and some other trickery. But the ActiveX way seems to be more modular.
Is it worthwhile to separate the charting modules from the exe and make an activex dll for this purpose?
View 5 Replies
View Related
Feb 28, 2013
how to produce a period signal that lasts 0.100 ms that is 35% red and 65% green using a bi-colour LED and the timer module?
while(ReadTimer0() < (unsigned int)165)
Its using this: OpenTimer0(TIMER_INT_OFF & T0_SOURCE_INT & T0_16BIT & T0_PS_1_32);
So does that mean that the period signal is 165 * 32 * 4/32 = 660 = 66%? I really just need to know how to calculate the period signal to produce 35% red and 65% green..
View 1 Replies
View Related
Nov 3, 2013
Code:
/*Currency Conv Control Module*/
#include <stdio.h>
#include "currencyconv.h" /* defines constants, declares functions */
int main(void) {
float us_dollars;
float currency;
int user_input;
[Code] ....
This is $$ converter program I created that is split up over 3 files. It takes the users input in US Dollars and converts it to the currency selected. When executing the program I am encountering a small problem. It actually isn't converting anything and returns 0.00 dollars.
I would like for it to convert the amount entered into the currency selected. I would also like to add in the print statement the type of currency the user has selected.
View 3 Replies
View Related
Sep 7, 2013
Exmaple:
112121276783621784678236478236478623784672364782367846237846782364782367846238 + 783627846782364786237846782364782367846237846782364782367846237846237864782367846238
It should be efficient and fast. It is useful to calculate the Factorial 100000, and then I calculate the number of the module.
Example:
132142344564378657834657834657863785634786578346578346785634785678653478 % 124623874
View 2 Replies
View Related
Jul 9, 2013
I am facing an issue with re entrance of one of my dll module. I had MLClient.dll which load in to program using LoadLibrary(MLClient.dll)
boost:: shared_ptr will add a lock() on this Load & initialization of library.
Due some of my requirements I want to un initialize this library and unload.?
How can i do the same with windows functions.?
How can i leave the lock on library using boost::shared_ptr.?
un load if there is a lock() on it ?
View 1 Replies
View Related
Jul 10, 2013
I have faced a strange problem in File Save Routine. I have written a module to save data to binary file . I have designed a structure and put information in that and save it to file . I save multiple such records one after other. I use fwrite , fflush instructions.
The module is working fine. I have saved near about 35 such files. But in one file , the module has saved Blank Records. The file size if perfect but the file is totally blank. It has happened for only one file but need to know the reason.
View 14 Replies
View Related
Sep 27, 2012
I don`t known how to convert IP to hex .
In this link [URL] .... . I see hex IP : Hex IP 0x462a1779
I want to convert IP "70.42.23.121" to "0x462a1779"
Code:
#include <winsock.h>
#include <windows.h>
#include <stdio.h>
UINT32 ip_to_hex(UINT32 ip_add) {
UINT32 ip_hex;
//code convert ip to hex
return ip_hex;
[Code[ ....
And this is result : 7b 1e 80 and a , not 0a
Further i think we must separate each octect by a (dot) . , Then convert decimal to hex.
View 6 Replies
View Related
Jun 11, 2014
I am trying to make this code working and to remake it to work also for RGB to HSB? This code is for C and I need to make it working in Visual Studio C++ .
Code:
// mask1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <stdio.h>
#include <math.h>
typedef struct RGB_t { unsigned char red, green, blue; } RGB;
typedef struct HSB_t { float hue, saturation, brightness; } HSB;
[code]....
Error I got is error C3861: 'fmaxf': identifier not found
What file or namespace should I include. Do I need to add some library into linker?
View 14 Replies
View Related
Oct 5, 2012
If I drop this regular dll project and create a new MFC extension dll project, it will involve too much work. I wonder if there is relatively easier way to convert an existing regular dll project to a MFC extension dll project? BTW, how can I tell a MFC extension dll project from a regular dll project?
View 1 Replies
View Related
Sep 26, 2013
Problem:Given any amount of money expressed in dollars, and cents, this program computes the number of 100 , 50, 20, 10, 5 and 1 dollar bills and number of quarters, dimes, nickels, and pennies to be returned, returning how many of each denomination are included.
I figured out how to program it correctly for the most part except I cannot figure out how to handle large numbers, such as 14.49999999999999999999999999999999.When converting that number to int it returns it as 14.50. How to handle converting doubles, similar to the one above, to an integer correctly?
This is the code that my teacher did not want, since I handled the input as a string:
Code:
#include <iostream>
#include <string>
#include<iomanip>
#include<windows.h>
using namespace std;
int main(){
const int hundredsConst=10000, fiftiesConst=5000, twentiesConst=2000, tensConst=1000;
[code].....
View 3 Replies
View Related
Nov 7, 2012
I'm trying to read in two instances of date and time (from user input) into a string value (MM/DD/YY hh:mm).
I need to be able to calculate the difference between the two in order to return how much time has elapsed from the first date/time to the second date/time.
What would be the most efficient way to go about obtaining said results?
I was thinking I need to convert each year, month, day, hour, and minutes into its own integer variable, after researching immensely online I'm still not sure how to convert from a string of characters to an integer.
View 10 Replies
View Related
Feb 25, 2013
IDE = Visual Studio 2008 Express
I am a novice programmer(still...) , and I am trying to build the Code Project project located at this address:
[URL] .....
The project page is titled " Remote Control PCs ".
I would like to use this program plus I wanted to practice programming using the code base. However, I don't have MFC so I thought I would just convert it to non-MFC.
For example, It seems to me that any class inherited from MFC would need to be reimplemented. I think I also need to reimplement any code that uses "stdafx.h"
I built a custom project out of the zlib library and compiled it as a Windows library with the /MT settings. Both 32 and 64 bit library files, in Release and Debug mode, are included. The ZLIB.H and ZCONF.H files are also included. For examples of single-threaded usage, see the CZLib class. For examples of multi-threaded usage, see the classes CDriveMultiThreadedCompression, CMultiThreadedCompression, and CZLib.
1)How should I go about compiling this zlib custom project?
2)Where does the /MT option go ?
3)How do I use the output ( zlib.lib - I guess)?
View 9 Replies
View Related
Mar 12, 2013
I m loading a png image by using the ATLImage library.
CImage Image;
Image.Load (L"D:ImagesPNG_ImagesImage7.png");
how to retrieve the byte array value of this png image. I tried retrieving it as
byte *png = reinterpret_cast<BYTE *>(Image.GetBits());
but when i access the data , der is a loss of data while converting it in the above manner.
I found a snippet in net for decoding the raw data . but der is a line is the code which is unknown to me. The code is as follows :
CImage atlImage;
HMODULE hMod = GetModuleHandle(NULL);
atlImage.Load(bstr);
void* pPixel = atlImage.GetBits();
intpitch = atlImage.GetPitch();
intdepth = atlImage.GetBPP();
[Code] ....
How do I get the byte * value form the png image loaded?
View 3 Replies
View Related
May 8, 2013
i am trying to create a firework display by reading in the fireworks off a .xml file, which will then iterate through and launch each firework.
I followed a tutorial on dinomage to find out how to use tinyxml, i learnt that i can store the attributes into char pointers but i dont know how to convert them to GLfloats to store them in my class variables.
I did try using atof but when i ran the program i got loads of errors which im guessing is because the pointer only stores the address which im passing to my variable.
Update
i have found out that tinyxml is not compatible with vs2010 but tinyxml 2 is, so i have changed my code but am still having trouble loading my attributes i have added error checking, and it prints out that the xml has loaded but then it wont load the root
updated code
my code: Firework.h
Code:
#ifndef FIREWORK_H
#define FIREWORK_H
#include <cstdlib>
#include <GLGL.h>
#include <string>
[Code].....
View 14 Replies
View Related
Sep 5, 2013
I receive a byte stream. The first 8 bytes contain an Identification number. I receive at first the lowest byte and at the end the highest byte of the number. How can I transform this into a double value and later back into the bytestream? In the past I hard only 2 Byte values and there I could use things like MAKEWORD and HIBYTE and LOWBYTE to convert the values
View 4 Replies
View Related
Jun 13, 2013
I have total time in seconds (say 2500 seconds). I want to store this time in CTime or CTimeSpan format.?
How to do this.?
View 2 Replies
View Related
Nov 20, 2012
Working in Win32 console app (VS 2010) I have been trying to convert several Unicode (UTF-16) C++ functions to Ansi C (UTF-8). The test app includes two tokenizer classes, each of which work perfectly well in their respective environments, CTokA and CTokW (UTF-8 and UTF-16).
A problem arises when I attempt to run the UTF-8 functions when the Character Set properties is set to 'Use Unicode Character Set' in that std::string manipulations do not perform as expected, e.g.,
printf("start
");
gets reproduced as
printf("start
");══════════ ²²²²
Attempting to null terminate the string where it is supposed to end simply results in a space in that position and the garbage end persists, e.g.,
printf("sta t
");══════════ ²²²²
Code:
sline[11] = 0x0000;
If I attempt to change the Character Set property to 'Use Multibyte Character Set' or 'Not Set', the app will not compile and hundreds of errors occur. Of course, I can eliminate all of the UTF-16 code, but it strikes me that it should not be necessary. Perhaps if M$ made everything UTF-16 without all of the necessary decorations like 'L' and '_T(', life would be much simpler. Unfortunately, I have a very extensive UTF-8 app under 10 years of development that works quite well, but my UTF-16 (Unicode) conversion doesnt work as well because of the mixing of pointers (I think), so I have had to revert much of the code back to UTF-8. (All of which has nothing to do with my question but is simply psychotheraputic for me to ventilate on.)
My question is this: Can UTF-8 and UTF-16 code coexist in a single Win32 console app?
View 6 Replies
View Related
Sep 8, 2014
I am new to VC++ 2012. I have this code snippet.
Code:
auto it = query_map.find(U("callback"));
The problem is right under the dot there is a red line the error is
Error1error C2664: 'std::_Tree_iterator<_Mytree> std::_Tree<_Traits>::find(const http::uri::encoded_string &)' : cannot convert parameter 1 from 'const wchar_t [9]' to 'const http::uri::encoded_string &'d:maverickprojectsstrikeforcesrcserverserverserver.cpp26
What is the solution to this error?
View 3 Replies
View Related
Apr 26, 2014
Write A Program which converts a string of uppercase letters into its corresponding lowercase.Using pointers to access the members of the Array.
Write A program that reads eight float numbers into an array and then print out the second,fourth,sixth and eight members of the array,
And Sum of the first,third,fifth,and seventh. Using pointers to access the members of the array.
View 2 Replies
View Related
Jan 10, 2014
I have a bitmap header information in the struct
typedef struct tagBITMAPINFO {
BITMAPINFOHEADER bmiHeader;
RGBQUAD bmiColors[1];
} BITMAPINFO
The total size of this is 1080.
Now i want to convert this into a unsigned char pointer.
unsigned char * pBMPHeaderData;
I already got the raw image data in another unsigned char buffer.
unsigned char* pRawBMPData;
Now i want to make a complete BMP image by adding the header info and raw data into a new unsigned char pointer. For this i need to convert the BITMAPINFO struct into a unsigned char *
So the new buffer will be,
unsigned char * pCompleteBMPIMageData = pBMPHeaderData + pRawBMPData;
how to do this?
View 3 Replies
View Related
Feb 19, 2013
In short I'm converting a floating point bilinear image resampling routine into one that only uses fixed point arithmetic. I've gotten rid of nearly all the floats now, in fact all but one and the results at the moment are in distinguishable from the floating point version. It's a maths issue really. Some pseudocode goes like this.
Code:
for( int xx=0; xx<ow; xx++ ) {
int_center = (ccx >> 16);
int temp = xx * 2;
for (j = int_center; j <= int_center + 1; j++)
[Code] ....
Where ccx is and integer error accumulator that gives me a scaled integer. Shifting down buy 16 gives me the relative pixel I need to be working on. The line just after where the inner loop begins is where I have the last remaining float. FILTER_FACTOR is essentially a percentage by which I scale the error accumulator to the correct amount.
For example.
ccx = 98303. Which is a value of 1.5 when shited down by 16 bits. Obviously I can shift it because it will round and I lose the precision. Lets say FILTER_FACTOR is 39321. Which is 60% of 1 (65535) So what I'd like to know is, is it possible to use the FILTER_FACTOR as an integer and do some fancy integer math to scale the result from (ccx - (j<<16)) by the representative amount that is FILTER_FACTOR. In this example 60%. Effectively getting 40% of (ccx - (j<<16)) At the moment FILTER_FACTOR is still a float and therefore 0.6, which of course works just fine.
View 4 Replies
View Related
Sep 23, 2012
Code:
template<class T>
class Convert {
T data;
public:
Convert(const T& tData = T()) : data(tData)
[Code] ....
Why do we use operator? Is float and double function names below?
Code:
Convert<int>::operator<float> float();
Convert<int>::operator<double> double();
View 1 Replies
View Related
Jun 15, 2013
I am using Visual Studio 2008. I just wonder if there are any library function in Windows SDK or MFC, or from third-parties, that can convert a UTF-8 string into Windows Unicode string(used in CString object).
Can MultiByteToWideChar or ATL String conversion macro like A2W to the conversion?
View 1 Replies
View Related
Nov 17, 2013
I captured .ppm from avi file. How can I convert .ppm into .jpg only using C.
View 3 Replies
View Related
Mar 30, 2014
I was assigned a problem involving using buffer overflow to access a different function than I was supposed to. I was able to figure out how to modify the point in stack that I need to change using a printf statement, however what doesn't make sense is that when I use the input "AABBCCDDEEFFGGx86x64x00x00" the stack changes to 78363878 I looked up the ascii codes and I assume that it's not converting x86, but using the input x86 instead.
View 4 Replies
View Related