|
Are you just wanting to change the output directory? Look into the project settings.
Correct me if I got you wrong.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Hi Rajesh,
Thanks for ur reply.
Intially , i have 2 project in my solution (1)Win32 Application- AppServer , (2) Setup project .
from this i created an MSI and installed my AppServer.exe to local & remote machine.
Now my requirement is , i have to register my application as windows services, so i have added one more project as WindowsService1
from VC++->Windowservice option,
i have builded all the 3 project and installed my Setup project , i tried to start my exe from services.msc, but here i am able to see
Servicename: Service1
Path: C:\testing\windowsService1\WindowsServcie1.exe
not C:\testing\AppServer\Appserver.exe
I need my Servicename as : Service1
& Path as C:\testing\AppServer\Appserver.exe
i mean my service has to point to my Win32 application exe.
Plz thru some light on this
Your help much appreciated.
Regds
Jain
|
|
|
|
|
I'm not sure if you need a third project, just for the sake of registering your executable as a windows service. In my opinion, the setup must have provision to register a program being installed as a service. Have you checked on that?
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Yes Rajesh, i am able to install a service thru setup project (if i select windows service project template) ,
THE PROBELM IS:
i have
solution :testing
project1: windowsservice1 (Windowsservice project)
project2: AppServer (Win32 application project)---> this is my main application AppServer.exe
project3: ServerSetup (SetupProject)
If i do run my MSI file from ServerSetup, its installing AppServer.exe to C:\program files\AppServer\AppServer.exe
and in Services i have only Servicename: AppServer , Path :C:\program files\AppServer\WindowsService1.exe (instead of AppServer.exe)
i hope nw i expained correctly
Regds
jain
|
|
|
|
|
Hi All,
How can build my project(vc8) using batch file in both type i.e debug and release?
|
|
|
|
|
Try the devenv[^] command from Microsoft. Alternatively you can create your own makefile[^] and use that.
|
|
|
|
|
Visual Studio 2008 example
"C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\VCExpress.exe" "C:\Projects\Error_Code\Error_Code.sln" /rebuild Debug /OUT "C:\LOGS\Debug\Error_Code.log"
Visual Studio 2005 example
cd C:\Program Files\Microsoft Visual Studio .NET\Common7\IDE
devenv.exe "C:\Projects\Error_Code\Error_Code.sln /rebuild Debug /OUT "C:\LOGS\Debug\Error_Code.log" /projectconfig Y3 /projectconfig EHsc /projectconfig RTC1 /projectconfig MDd /projectconfig RTCC /OUT
|
|
|
|
|
Hi All,
I am getting the error while building the project. What can be cause of this error......
names.obj : error LNK2001: unresolved external symbol _f002procedure_coverage_informat
names.obj : error LNK2001: unresolved external symbol _f000close_coverage_data_output_
names.obj : error LNK2001: unresolved external symbol _f000open_coverage_data_output_s
names.obj : error LNK2001: unresolved external symbol _f000finish_coverage_measurement
names.obj : error LNK2001: unresolved external symbol _initialize_code_coverage_module
run.obj : error LNK2001: unresolved external symbol _initialize_code_coverage_module
Debug_Test/ext_tests.exe : fatal error LNK1120: 77 unresolved externals
|
|
|
|
|
Check if you added to the Visual Environment, as a first step, the correct configuration for external libreries:
* Open Visual
* Choose menu "Tools" and select "Options"
* In "Projects and Solutions" and go to "VC++ Directories"
* Show directories for "Library Files" and "Include files"
* Add your libraries and includes you need for your project.
This is the most common error while linking
|
|
|
|
|
This application is in vc6 and I have no much idea about vc6...Could you tell me how to do in vc6
|
|
|
|
|
mmmm... I would say is basically the same :S
|
|
|
|
|
Hello all,
I´m trying to multithread an application by using CreateThread function. So far I´ve done the following:
LPDWORD iID;
HANDLE hThread;
hThread = CreateThread (
0,
0,
(LPTHREAD_START_ROUTINE)OpenCVWin32::Form1::Threadi,
NULL,
CREATE_SUSPENDED,
iID);
}
static DWORD WINAPI Threadi()
{
System::Windows::Forms::MessageBox::Show("Hi there!");
return 0;
}
When I launch the application, the thread is not created, as I cannot go inside the Threadi function. I´m right now using VC++ 2008. Does anyone has a suggestion on why this could be happening?
Thanks
|
|
|
|
|
kikoso wrote: CREATE_SUSPENDED,
This is the problem. If you use this attribute then the thread is created in suspended state. More Info Here[^]
If you want the thread to start as soon as you launch the application, don't create a thread in suspended state. If you want to create in suspended state, then you can use ResumeThread() function.
|
|
|
|
|
Thank you HimanshuJoshi. I was reading in zig-zag the doc, so I didn´t realize about it.
I still have some problems. After changing it, I have a problem accessing the memory. This is the error I got (after using 0 instead of CREATE_SUSPENDED,:
<br />
Unhandled exception at 0x003628c2 in OpenCV Win32.exe: 0xC0000005: Access violation reading at position 0x0000000c.<br />
I´ve been thinking about sending the 3 parameter as
(LPTHREAD_START_ROUTINE)&OpenCVWin32::Form1::Threadi,
But I got a different error:
error C3374: Address of "OpenCVWin32:: Form1:: Threadi" can only be adopted if a delegate instance is created.
I will appreciate any suggestions. Thank you
|
|
|
|
|
LPTHREAD_START_ROUTINE is defined as:
typedef DWORD (WINAPI *PTHREAD_START_ROUTINE)(
LPVOID lpThreadParameter
);
typedef PTHREAD_START_ROUTINE LPTHREAD_START_ROUTINE;
so, your thread function is to be:
static DWORD WINAPI Threadi(LPVOID lpThreadParameter)
{
System::Windows::Forms::MessageBox::Show("Hi there!");
return 0;
}
|
|
|
|
|
Hello!
Thank you! I didn´t though that passing the parameters will be compulsory. But nevermind, I put it on my code.
|
|
|
|
|
If you're using MFC, you *must* use AfxBeginThread to begin a worker thread. If you are using Win32, you should be using _beginthreadex to create a thread.
CreateThread is an API and that will even create a thread if you're linking to the single threaded version of the CRT (which will inevitably lead to disaster).
If you're writing managed code, take a look at Thread.Start method in the documentation. Basically, I want to emphasise that there's no sane reason or excuse to use CreateThread from your code. There are safer and sane alternatives.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Hello,
I finally found the problem. The code for the Thread Function was inside the ref class, so that made it managed code. I finally put outside it, and now is working fine
Thank you.
|
|
|
|
|
I was having this initially
double* m_Value [4];
I want to redefine it differently.So what I did is
typedef vector <double> DOUBLE_VECTOR;
DOUBLE_VECTOR DoubleVec;
vector <double_vector> m_Value;
Above I did in .h file
Now I initialize it in constructor I mean .cpp file
DoubleVec.resize (10,0.0);
m_SplitArrPtr.resize (5,DoubleVec);
Till here I thing I have done fine.
Issue:
Now there is a function whose defination is somewhat like this
static void Func (double& ObjData,void* DataPtr);
In above function I have to fill the ObjData by DataPtr OK
So I did this
void ClassName::Func (double& ObjData,void* DataPtr)
{
int RowIndex = 0; // row index
int ColIndex = 0; // column index
//copy data to existing structure
for (RowIndex;
RowIndex < 5;
RowIndex++)
{
for(ColIndex;
ColIndex < 10;
ColIndex++)
{
ObjData [RowIndex][ColIndex] = DataPtr->m_Value [RowIndex][ColIndex];
} //for ColIndex
} // for RowIndex
}
But I am facing an error
"error C2109: subscript requires array or pointer type"
So please help me out that how I will be able to fill the ObjData.
|
|
|
|
|
Please, read the posting guidelines and format your code properly, it is almost unreadable.
deadlyabbas wrote: static void Func (double& ObjData,void* DataPtr);
deadlyabbas wrote: ObjData [RowIndex][ColIndex] = DataPtr->m_Value [RowIndex][ColIndex];
ObjData is a double, not an array so you can't use it like an array. DataPtr is a pointer to void, so if you want to access its content, you first have to cast it to something appropriate. Why are you using a pointer to void here ?
|
|
|
|
|
ObjData is a double &. To use two subscripts (ObjData[RowIndex][ColIndex]). You have to have a two dimensional array such as double **ObjData.
|
|
|
|
|
Hi ,
I just wanted to know, how can I register a service using Visual studio setup project. I can create a Setup Project successfully, it installs all the program, but I need a hint on how to run register my exe as one of the services
And of course how can I unRegister the Service when
uninstalling the application.
Your help much appreciated.
Regds
Jain
|
|
|
|
|
i have added a method in a header file as follows
void TestMethod()
{
..........
}
Now this header file is included in many places of same project.
The following error link error occurs.
Test.obj : error LNK2005: "void __cdecl TestMethod(void)" (?TestMethod@@YAXXZ) already defined in Test2.obj
How to rectify this error?
|
|
|
|
|
Why do you put the definition of your function in a header file ? Usually it is much better practice to move it to a cpp file.
Anyway, what you can do to remove your problem is make use of include guards. Surround your code in the file with this (replace MYFILE by something unique, typically the file name):
#ifndef MYFILE
#define MYFILE
....
#endif
You can also put #pragma once at the top of your file. Google for "include guards" for more information.
|
|
|
|
|
i tried with
#pragma once
its not working.
|
|
|
|