asifjavaid 0 Light Poster

Right, I understand the things more better now. Now I have one confusion.
1. If we use local storage butter data, in silverlight i think that will be its isolated space. There must be a available space issue, because, I have created video from webcam can which is uncompressed AVI format. Its size is almost 5 seconds but its size is very huge 161MB. And that will might be a problem in case of long duration videos.

  1. What you suggest If I write all bytes in a text file which will be stored in isolated space, and then in onStop event then sent that file to the server but issuing a warning to the user ? Then at the server by recieving the text file, read it and create the video file at the server by using AVI/WMV wrapper.
asifjavaid 0 Light Poster

Ah right, so I think here are the steps I have to follow, and please correct me if I am wrong anywhere.

  1. In VideoSink there is a method which I need to override.

    protected override void OnSample(long sampleTime, long frameDuration, byte[] sampleData)
    {
    }

  2. I have to write a Tcp Stream Socket listener SERVER, which running on a specific port. This server will create a new socket for each client. In this project the client will be the Silverlight Application.

  3. In the OnSample method, we need to send the byte array to the Server which will then right the byte array to the file. And because the byte arrays are raw (uncompressed) data then we have to encode it on to specific format avi/wmv before writing to a file.

Any more suggestions and precautions which I need to take care of you are welcome to suggest:).

Many Thanks again.

asifjavaid 0 Light Poster

I am using Silverlight Application project, Visual Studio 2012.
In System.Windows.Media namespace
AudioSink is availble
VideoSink is available
FileSink is not available.

I think it is available only for Silverlight Windows Phone.

asifjavaid 0 Light Poster

Hi Ketsuekiame,

I have got lot of understanding how to proceed with this further.
Yes you are right I will use streaming to the server.
For sending webcam stream to a specific IP Address and port, I have gone through the article http://www.silverlightshow.net/items/The-ABC-of-streaming-in-Silverlight.aspx

But in this article, it shows that the streaming is dependent on Expression Encoder OR VLC. But we want to make it browser application, so that in production environment there must be a way to send webcam stream to the server without using anything third part software.

Could you please guide me the best way OR an SDK for silverlight to send the webcam stream to the server in silverlight?

Thanks.

asifjavaid 0 Light Poster

Many thanks for the answer.

  1. Can you give me any sample code or a link in which we can learn how to stream the video and save it to the server directly, both client and service code samples ?

Thanks.

asifjavaid 0 Light Poster

Hi All,

I want to develop an application in which I want to record a video in silverlight and send it to the server. I have the following questions in my mind.

  1. In which format the video will be record in silverlight using Webcam ? (Raw format OR WMV OR anything else ?)
  2. If it is a Raw format, then can we transcode it to WMV OR any other format?
  3. Where the recorded video will be saved in silverlight? I think it will be on Isolated space. What will be the best way to send the recorded video to server to save it which will take less bandwidth?
  4. How can we encrypt the video in silverlight if we need to save the bandwidth?

Any help will be highly appreciated. Waiting for the reply.

Many Thanks.

Asif Javaid.

asifjavaid 0 Light Poster

Hi all,

Likewise in SQL Server, after every transaction, an error number is set to the global variable @@ERROR. So we easily make a check in SQL SERVER stored procedure,

IF @@ERROR = 0 
SELECT 'SUCCESS'
ELSE
SELECT 'FAIL'

How can I do the similar thing in MySQL. How can I get the Error number or Error Code in mySQL, so that I can implement the same if check in mySQL Stored Procedure.

Basically I am transforming SQL Server 2008 database to MySQL database and stored procedures with same functionality.

I am looking forward a very helpful answer from you guys and it will be highly appreciated.

Thanks.

asifjavaid 0 Light Poster

Hi,

I am working on a application which is base on ADO.NET Entity Data Model. I want to insert Current Timestamp of Server while insertion and updation using LINQ query. Fox Example

INSERT INTO table SET time_field=CURRENT_TIMESTAMP() WHERE id=?"

I need to execute CURRENT_TIMESTAMP() in LINQ Query because I need to get Server timestamp while insertion or updation.

Please help me.

Any will help will be highly appreciated.

Many Thanks.

--

Regards.

Asif Javaid

asifjavaid 0 Light Poster

Hi all, Thanks very much for alls participation.
Arkm, yes you are right I can access the contents of void* buf_ptr by doing the following.

void* buf_ptr = NULL;
buf_ptr = malloc(1428480);
strcpy((char*)buf_ptr,"Asif Javaid");
char *p = (char*)buf_ptr;
printf("%c",*(p+1));

siddhant3s, your code can compile in gcc compiler but I am using Microsoft VC++9.0 comipler and it is generating an error of unknown size, as I do void*p = buf_ptr+1;

Many Thanks all.

asifjavaid 0 Light Poster

Hi all,
I working in VC++. I have a void pointer. I am assigning a memory block to it using malloc().
void* buf_ptr = NULL;
buf_ptr = malloc(1428480);

I am filling this buffer using fread(). and I want to index this buffer (buf_ptr) to acces its data. How can I do that.
I am facing the following errors.

Error 24 error C2036: 'void *' : unknown size c:\AMT_DLL_tester.cpp
Error 25 error C2440: '=' : cannot convert from 'void' to 'void *' c:\AMT_DLL_tester.cpp


Here is my source code

FILE *f_in = NULL;
f_in = fopen(argv[f],"rb"
);
if
( f_in == NULL )
        {
            fprintf(fptr,"ERROR: Could not open '%s'\n"
, argv[f] );
            fclose(fptr);
            return
 1;
        }

int
 buf_size = 1428480;
void
 *buf_ptr = NULL;

buf_ptr = malloc(buf_size+1);
items = fread(buf_ptr,buf_size,1,f_in);

void
* ptr = buf_ptr[20]; //----------->error

Please guide me how can I access the data of a void type buffer?

Your help will be highly appreciated..

Many Thanks.


Asif Javaid

asifjavaid 0 Light Poster

Hi,

I have a file of approximately 4.19GB. I want to get the totall size of file using code in VC++, Here is my code

FILE *fptrSampleVideo = fopen(filename,"rb+");

if(fptrSampleVideo)
{

fseek(fptrSampleVideo,0,SEEK_END);

uncompressedVideoSize = ftell(fptrSampleVideo);

}

If the file is of small size, ftell() return position correctly and the size is also correct.

If the file is of large size (4.19GB), ftell() return position 4, which is wrong.

It must return 4,190,000,000 etc. some thing like that.

can any one guide me what is the case?

Many Thanks,

--
Regards,
Asif

asifjavaid 0 Light Poster

Hi,

I am in problem. I have written some code in VC++.NET 2008. It is using third part AMT SDK. It is using file handling of C using fopen() function. The file are opened in binary mode (rb).

It is working very perfect according to our requirment on my local machine environment. But when i upload the same code on another machine with same operating system and environment, then I become surprise to notice that fopen() function doesn't works.

Can anyone please tell me my why FILE *fptr = fopen("fileName.bin","rb") fails to return a handle for a bin file. It is returning a NULL pointer?

I know some reasons that, files must be on a correct path and files must not be used by another process. But currently nothing is happening out of these reasons. The files are already placed on their correct path and are also not in any used.

I am calling fopen in a loop of 3 count. In first attempt of for loop, the file is open by fopen() but on second attempt, fopen() still returning a null pointer.

Please guide me in this case. I become stuck here. why fopen("fileName.bin","rb") fails and returning NULL value.

the errorno returned is here

The error number is 9

EBADF Bad file number 9

Here is my sample code

int file_count = 3;
for( int f=0; f<file_count; f++ )
	{
		FILE *f_in = NULL;
		size_t items;
		int buf_size; …
asifjavaid 0 Light Poster

Hi,

I have an application which is currently in VC++.NET 2003. It is using two static libraries,

1. mfc71d.lib
2. wsock32.lib.

Now I want to convert this application in VC++.NET 2005. But it contains mfc80d.lib instead of mfc71d.lib.
If I change this static library to mfc80d.lib, my application in VC++.NET 2005 compiles successfully but gives the following error message box occurs, when execute the application.

---------------------------
AMT_sample_app.exe - Unable To Locate Component
---------------------------
This application has failed to start because MFC80D.DLL was not found. Re-installing the application may fix this problem.
---------------------------
OK
---------------------------


Please guide me how can i Convert my VC++7.1 .NET 2003 application to VC++.NET 2005.


Many Thanks,
Asif

asifjavaid 0 Light Poster

The Below Links would help you.

http://www.csharphelp.com/archives/archive281.html
http://bytes.com/groups/net-c/273488-dynamically-create-com-objects-c

Hi,

These links are for C#.NET. I need to know the COM Programming in C++.NET 2005

asifjavaid 0 Light Poster

Hi,

I am new to COM Programming.

I want to initialize COM library. I am calling

hr = CoInitializeEX(NULL);

but hr = S_FAIL. and my code is stopped.

What I have to do further to execute COM program written in VC++.NET 2005.


--
Regards,
Asif

asifjavaid 0 Light Poster

COM only works with ActiveX components or Windows Services programs, all of which must be registered before they can be used. Here is how to register them. If that registration fails then its not written as a COM component and therefore can not be used the way your attempting to use it.

Thanks a lot.
Ancient Dragon. you have solved my problem. I have register the required dll and now its working perfectly.

--
Regards,
Asif

asifjavaid 0 Light Poster

Whose class is Cryptographer ? Is it registered ?

Hi,

Cryptographer is a namespace. and it has different structs and classes. TMMPlayerHelper is declared as struct in this namespace.

I did not perform any registration step because i did not know how to register it?


--
Regards,
Asif

asifjavaid 0 Light Poster

I have 1 line in this code that I can't get to compile. I'm new to C++ and begging for some help...any advise would be appreciated.

#include <iostream>
#include <iomanip>
using namespace std;

double population(double pop, double birthRate, double deathRate);
 void printPopulations(
  double startPop, double birthRate, double deathRate, int numYears);


	double population(double pop, double birthRate, double deathRate)
    {

double n = 0;

n = pop + (birthRate*pop) - (deathRate*pop);

return n;

}

void printPopulations(double startPop, double birthRate, double deathRate, int numYears)
{

for ( int i = 0 ; i < numYears ; i++ )
{
startPop = population (double birthRate, double deathRate, numYears, double n);
cout << "For year " << i+1 << " the population is " << startPop << endl ;
}

}



int main()
{
        double startPop,          
              birthRate,        
              deathRate;       
        int   numYears;         

        
        cout << "This program calculates population change.\n";
        cout << "Enter the starting population size: ";
        cin  >> startPop;
        while (startPop < 2.0)
        {
                cout << "Starting population must be 2 or more.  Please re-enter: ";
                cin  >> startPop; 
        }

        
        cout << "Enter the annual birth rate (as % of current population): ";
        cin  >> birthRate;
        while (birthRate < 0)
        {
                cout << "Birth rate percent cannot be negative.  Please re-enter: ";
                cin  >> birthRate;
        }

        birthRate = birthRate / 100;     

        cout << "Enter the annual death rate (as % of current population): ";
        cin  >> deathRate;
        while (deathRate < 0)
        {
                cout << "Death rate percent cannot be negative.  Please re-enter: ";
                cin  >> deathRate; …
asifjavaid 0 Light Poster

Hey, I am wondering how I can grab all the selected strings from a ListBox with multiple selection on...

I tried looking for it on google and everything, and I know about SelCount but I haven't been able to find out how to grab the strings or the indexes of the selected items...

Any help is appreciated, thanks :D
fmwyso

hi
which tool or language you using now.

In VC++.NET or C#,VB, there is property "SelectedItems" which returns a collection(array) of currently selected items.


--
Regards,
Asif

asifjavaid 0 Light Poster
#include <iostream>
#include <windows.h>

using namespace std;

int sOne = 1;
int sTwo = 2;
int sThree = 3;
int sFour = 4;
int sFive = 5;
int sSix = 6;
int sSeven = 7;
int sEight = 8;
int sNine = 9;

int win()
{
    cout<<"gratz, you win the game!";
    return (0);
}

int bDisplay()
{
    cout<<"\n\n\n\n\n";
    cout<<"\t\t\t\t"<<sOne<<" | "<<sTwo<<" | "<<sThree<<endl;
    cout<<"\t\t\t\t----------"<<endl;
    cout<<"\t\t\t\t"<<sFour<<" | "<<sFive<<" | "<<sSix<<endl;
    cout<<"\t\t\t\t----------"<<endl;
    cout<<"\t\t\t\t"<<sSeven<<" | "<<sEight<<" | "<<sNine<<endl;
    Sleep(2000);
    system("cls");
    move();    
}

int winCond()
{
    if (sOne == 'x' && sTwo == 'x' && sThree == 'x'){win();}
    if (sOne == 'x' && sFour == 'x' && sSeven == 'x'){win();}
    if (sOne == 'x' && sFive == 'x' && sNine == 'x'){win();}
    if (sTwo == 'x' && sFive == 'x' && sEight == 'x'){win();}
    if (sThree == 'x' && sFive == 'x' && sSeven == 'x'){win();}
    if (sThree == 'x' && sSix == 'x' && sNine == 'x'){win();}
    if (sFour == 'x' && sFive == 'x' && sSix == 'x'){win();}
    if (sSeven == 'x' && sEight == 'x' && sNine == 'x'){win();}
}


int move()
{
    bool repeat;
    char choice;
    winCond();
    
    do {
        
        repeat = false;
        cout<<"Please enter a selection 1-9:";
        cin>>choice;
        
        switch (choice)
        {
               case 1:
                    
                    sOne = 'x';
                    break;
                    
               case 2:
                    
                    sTwo = 'x';
                    break;
               
               case 3:
                    
                    sThree = 'x';
                    break;
                    
               case 4:
                    
                    sFour = 'x';
                    break;
                    
               case 5:
                    
                    sFive = 'x';
                    break;
                    
               case 6:
                    
                    sSix = 'x';
                    break;
                    
               case 7:
                    
                    sSeven = 'x';
                    break;
                    
               case 8:
                    
                    sEight = 'x';
                    break; …
asifjavaid 0 Light Poster

If I initialize graphics in my program and then use cout the font appears bigger than normal and the cursor doesn't blink on the screen as it does when the graphics are not initialized.Is there any way I can use graphics as well as cout in my program?If yes how to do that.

Hi,

There are two modes of programming in Borland C++.

1. text mode
2. graphics mode.

In text mode, we have 80 columns and 50 rows in windows xp but in graphics mode, we have 640 columns and 480 rows.
Every mode has its own define functions. We cannot use text mode function and graphics mode similarly, its opposite is too.

"cout " works only in text mode. It cannot be used in graphics mode instead you have to use graphics function to print some text in graphics mode.

try this function in graphics mode. outtextxy(x,y,"string to write");

int x = 300;
int y=200;
outtextxy(x,y,"Hello World");

//output:- The text will be printed approximately in the center of the graphic mode screen

--
Regards,
Asif

asifjavaid 0 Light Poster

Hi,

I working on COM Components in VC++.NET 2005,

HRESULT hr = spCrypt.CoCreateInstance(__uuidof(Cryptographer::TMMPlayerHelper), 0);
    if( FAILED(hr) )
        spCrypt = 0;

I am facing an error here.

I debug the code and found that "CoCreateInstance()" is returning a message

"Class is not registered"

an my program gets crash.

How can I resolve this problem? Please reply me soon.

--
Regards,
Asif

asifjavaid 0 Light Poster

I have make a win32 dll in VC++.NET 2005. It contains a simple add funtion.

I have also make a console client application in VC++.NET 2005.
how can i access that add function in my client application?

Regards
Asif

asifjavaid 0 Light Poster

Hi sir,


I am making a win32 dll in VC++.NET 2005. I make an add funtion in it and then i call it from C# using System.Runtime.InteropServices;

[DllImport("MXFWrapperMarvel.dll", EntryPoint = "add")]
static extern int add(int a, int b);

----------------------MXFWrapperMarvel.dll------------without header files---------------
#include "stdafx.h"
#include <AtlConv.h>

#ifdef _MANAGED
#pragma managed(push, off)
#endif

extern "C" __declspec(dllexport) int APIENTRY add(int a, int b)
{
    return a+b;
}


BOOL APIENTRY DllMain( HMODULE hModule, DWORD  ul_reason_for_call, LPVOID lpReserved)
{
    return TRUE;
}

#ifdef _MANAGED
#pragma managed(pop)
#endif
-------------------------------------------------------------------------------------------------

this add function working correctly.


But I want to include some header files of third party SDK.

---------------------MXFWrapperMarvel.dll-------------with header files-------------------

#include "stdafx.h"
#include <AtlConv.h>


#include "MOG/MXFComponents/EssenceAnalyzer/MPEG/EssenceTypes.h"
#include "MOG/MXFComponents/EssenceAnalyzer/AES3/EssenceTypes.h"
#include "MOG/MXFComponents/EssenceAnalyzer/BWave/EssenceTypes.h"
#include "MOG/MXFComponents/EssenceAnalyzer/AES3/S302M/EssenceTypes.h"

#ifdef _MANAGED
#pragma managed(push, off)
#endif

extern "C" __declspec(dllexport) int APIENTRY add(int a, int b)
{
    return a+b;
}


BOOL APIENTRY DllMain( HMODULE hModule, DWORD  ul_reason_for_call, LPVOID lpReserved)
{
    return TRUE;
}

#ifdef _MANAGED
#pragma managed(pop)
#endif

--------------------------------------------------------------------------------------------------

My code is compiled successfully, no errors and warnings. But when calling the add() function then, a runtime exception is raising while calling add() fuction...

"Unable to load DLL 'MXFWrapperMarvel.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)"

The dll is also placed on the right path but still raising exception. If I remove the above header files from dll code then my code also compiled successfully as well as add() function is also functioning correctly. But after just including those header files in dll code, …

asifjavaid 0 Light Poster

Hi all guys,

I am using MS VC++.NET 2003
I have also installed MS VS++2005 and 2008 on the same computer.

Now when I ran the previous programs which are programed in VC++2003, now I am facing the following errors.

Error spawning 'link.exe'
Error spawning 'cl.exe'.

can any one tell me what I have to do, whats going wrong.
Wait for the responce
Many Thanks

Asif

asifjavaid 0 Light Poster

Hi guys,

Hope you are fine by all means.

I am developing a video plugin in VC++.NET by using directshow filters. My software is getting input of wmv file and it will be uncompressed generating two files video and audio. Now i want to get input for MPEG-2 video format. To make MPEG-2 compatible to my software I have to convert it to wmv format.

How can I convert MPEG-2 video format to wmv video format?


Many Thanks

Asif

asifjavaid 0 Light Poster

hi guys,

working in C using Borland Compiler we can get scan codes of keyboards keys by this code

ch = getch();
  if (ch == 0)
      ch = getch();

   printf("%d",ch);

because when first time getch() is called, it will return the ascii code of the pressing key. when second time it called then it will return the scan code of that pressing key. So when we want to control our program with arrow keys, there ascii codes are 0 but scan codes are different.

Now while working in linux environment using gcc compiler. there is no conio.h header file in it and we have such function getch(). so how can we get the scan code for arrows and functional keys in C using gcc compiler.

Many Thanks

Asif

asifjavaid 0 Light Poster

hi guys,

i have declared a char pointer. i am using this in itoa() function to convert integer data into hex data e.g

char * hexData= NULL;
             itoa(1484820,hexData,16);

this results in equalent of 1484820 in hex decimal and store it in hexData.

now when I want to some process in hexData(char pointer). when I pass it to my function for further process, the value of hexData(char pointer is changed now contains garbage) see the code below

main()
{
char * hexData=NULL;
itoa(148420,hexData,16);
printf("%s",hexData);---------------------//output is 243C4
writeinFile(hexData,fptr);
}

writeinFile(char* str, FILE *fptr)
{

printf("%s",hexData);---------------------//output is 2434C but some time a garbage value
char *hex = new char[30];
printf("%s",hexData);---------------------//output is always garbage value after any new   
                                                          //char *pointer declaration.

----
----
----
}

}

I am confused whats problem going on here.
can any tell me its solution?


Asif

asifjavaid 0 Light Poster

hi guys,

I want to call win32 dll in C#. It has parameters encode(char *argv[]).

what i have to write in in C# in the placa of char *argv[]. I have make my efforts see my code below but vain.

// in C++ 
int ConvertBinToAmt(char JFIF_NTSC_XML_File1[],char JFIF_NTSC_XML_File2[],	char DestinationFolderName[],char *argv[])

//in C#
 static extern int ConvertBinToAmt(char[] JFIF_NTSC_XML_File1, char[] JFIF_NTSC_XML_File2, char[] DestinationFolderName, char[][] argv);

// in button click event of C# 
   unsafe
   {
                char[][] ptr = new char[3][];
                ptr[0] = "video_output_interlaced_output.bin".ToCharArray();
                ptr[1] = "audio_channel_output_1.bin".ToCharArray();
                ptr[2] = "audio_channel_output_2.bin".ToCharArray();
                int b = ConvertBinToAmt("JFIF_10_1_NTSC_2A.xml".ToCharArray(),
                                     "JFIF_10_1_NTSC_2A.xml".ToCharArray(),
                                        "tenis_NTSC_output".ToCharArray(),
                                        ptr);
                                        
                                       

     }

//The output contains error messages
//Cannot marshal 'parameter #4': There is no marshaling support for nested arrays.

please help me what I do I need early responce as soon as possible.

Many Thanks

Asif

asifjavaid 0 Light Poster

Thank you for your reply
I forgot to say that I will use a class member function in Dlinked_list.
the contact saved in currnode->contact.
Inside the void Dlinked_list::printAll() , the (currnode->contact).print not work.
How can I fix it?

Dlinked_list list;
list.insert(new Contact("Ada", "ada@ust.hk", "12345678"));

typedef struct DLL_node {

DLL_node *prev;
DLL_node *next;
Contact *contact;


} DLL_node;


void Dlinked_list::printAll()
{
DLL_node* newnode =	new DLL_node;
DLL_node* currnode = head;


(currnode->contact).print <-this code not work

}

Hi your code is absolutely right. It is working correctly I have tested it. Well I think your calling is not correct.

currnode->contact).print;    //this is not correct
currnode->contact->print(); // this works perfect.

okay

asifjavaid 0 Light Poster

Well sir hurrah! this is now works for me

vt->bstrVal = SysAllocString(L"Video.bin");

But sir another issue now comes that after successfull comiplation of my code when it executing the function

VariantInit(vt); // initialize the variant

It gives me Access voliation error. Should we have to allocate it dynamically using malloc() or new operator?
Thanks

Well hurrah! Ancient Dragon sir you great, Thanks for you good help. I have solved my problem. Many Many.thanks

asifjavaid 0 Light Poster

yup sir again it was my spelling mistake and now 1st error is removed but still 2nd error comes. It is saying about const OLECHAR *.... see

TestingDirectShowManually.cpp(312) : error C2664: 'SysAllocString' : cannot convert parameter 1 from 'const char [12]' to 'const OLECHAR *'

Well sir hurrah! this is now works for me

vt->bstrVal = SysAllocString(L"Video.bin");

But sir another issue now comes that after successfull comiplation of my code when it executing the function

VariantInit(vt); // initialize the variant

It gives me Access voliation error. Should we have to allocate it dynamically using malloc() or new operator?

Thanks

asifjavaid 0 Light Poster

Yup sorry sir that was my spelling mistake. But now here is another compile response...

error C2039: 'bstr_val' : is not a member of 'tagVARIANT'
: see declaration of 'tagVARIANT'
TestingDirectShowManually.cpp(312) : error C2664: 'SysAllocString' : cannot convert parameter 1 from 'const char [12]' to 'const OLECHAR *'

Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

yup sir again it was my spelling mistake and now 1st error is removed but still 2nd error comes. It is saying about const OLECHAR *.... see

TestingDirectShowManually.cpp(312) : error C2664: 'SysAllocString' : cannot convert parameter 1 from 'const char [12]' to 'const OLECHAR *'
asifjavaid 0 Light Poster

See the spelling in the error message -- you spelled it wrong. For the header file, just include windows.h or see MSDN

Yup sorry sir that was my spelling mistake. But now here is another compile response...

error C2039: 'bstr_val' : is not a member of 'tagVARIANT'
: see declaration of 'tagVARIANT'
TestingDirectShowManually.cpp(312) : error C2664: 'SysAllocString' : cannot convert parameter 1 from 'const char [12]' to 'const OLECHAR *'

Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
asifjavaid 0 Light Poster

Here is how to allocate a BSTR. There are a few variations of SysAllocString() -- use the one that suits the purpose of your program.

VARIANT vt;
VariantInit(&vt); // initialize the variant
vt.vt = VT_BSTR; // set to BSTR string
vt.bstr_val = SysAllocString(_TEXT("Hello World"));

Thank you so much for reply,

I which header file this function is sysAllocString() resides? Now the compiler gives me the following error.
'SysAllocateString': identifier not found, even with argument-dependent lookup

Many Thanks
Asif

asifjavaid 0 Light Poster

Hi fellows,

How can I set a value of any type in VARIANT const pointer? I am tried my best but vain. I am facing compile time error.

Here is sample code

VARIANT *v=NULL;
        v->bstrVal = "Video.Bin";

another try

VARIANT *pValue;
//BSTR *fileName;
const char* pName;
pName = "Video.bin";
pValue = pName;

Many Thanks
Asif

asifjavaid 0 Light Poster

Do you actually want to convert to little endian or is this some kind of homework project? Because converting to hexadecimal doesn't enter into the picture if you're working with the bytes. The representation only matters for display and such.

Sir I want to do ti actually because I am professional Software Engineer working in a software house and currently this is my requirement, but i am stuck here. Many thanks

Asif Javaid

asifjavaid 0 Light Poster

hi sir,

my problem is that

I have an integer value e.g. 1428480.
first I have to convert it into hexa decimal format ---------> 0x15cc00.
convert the resultant hexa format data into little endian format ---------> 0x00cc15
write the little endian hex format data into the binary file.

to write binary or hex data into the binary file I am using putc()method having two parameters.

That what I want to do sir...

asifjavaid 0 Light Poster

Regrettably you don't understand me.

char* str = "0x15";
int value;
char* junk;
...
value = strtol(str+2,&junk,16); /* str+2 <=> skip 0x */
...

Well sir I understand you and did exactly what you said but still it is in problem see my whole code below

int sample_size = 720*496*4;
char *buffer = buffer = new char[8];
char *hexValue;
itoa(sample_size,buffer,16);
hexValue = new char[5];

		while(buffer[i]!=NULL)
		{
			hexValue[0] = '0';
			hexValue[1] = 'x';
			hexValue[2] = buffer[i];
			hexValue[3] = buffer[i+1];
			hexValue[4] = '\0';
			
			value = strtol(hexValue+2,&stopstring,16); /* value is again = 0 but i need 0xnnn*/
			putc(value,fptrSampleVideo);  // writing to the file
			i++;
		}
		delete(hexValue);
		delete(buffer);
asifjavaid 0 Light Poster

>Of course, atoi() converts the leading zero for you.
>Skip "0x" then use strtol() function.
>It's so easy...

well sir many thanks for respoonce

my problem is that I dont want to skip "0x" because this is way we can write binary data into the file e.g

putc(0x15,fptrSample);

now i want to generate "0x15" at runtime which in a char string and first parameter type of putc() is int. So if i skip "0x" the writing into file will be only 15 but I want to write "0x15" so that binary will be written. okay

Many thanks

waiting for your responce

asifjavaid 0 Light Poster

hi all,

I want to convert a string contain hex format '0x15' and what to convert it integer because i want to write data contain by a integer variable in hex format (binary data) into the file.

here is my code

char * str = "0x15";
int value;

FILE FILE *fptrSample = fopen("e:\\sample.txt","rb+");
if (fptrSample)
{
    value = atoi(str);
    putc(value,fptrSample);
    fclose(fptrSample);
}

after executing this
output is
value = 0

where as i want to the correct output
value = 0x15


can any one help me?.................

asifjavaid 0 Light Poster

Hi all :) ,
I am working on video plug-in in C++.NET. I have a video file. Its size is not fixed. It can be in MBs or GBs. I have calculated sample size and sample count of video file and now I want to prepend (insert in the beginning of video file) this information in the video file. I tried all modes of file handling in C. I also tried to open the file in append mode but and move the file pointer in start by rewind() and fseek() but all my efforts are wasted. I want to do this without creating another new file (insert the sample information first and then append rest of video file information and then remove the older one.) because file size can be large and it will take too much time complete the process.

Guys I need the best solution in this case as earliest as possible:icon_neutral: ...


Many Thanks

Kind Regards

Asif Javaid Chughtai
Software Engineer
IT Marvel Lahore
Pakistan

asifjavaid 0 Light Poster

hi guys ,
hope you are all fine.

i want to created MS word doc file to pdf file converter in MS Visual Studio 2005..
can any one help me what will be the procedure to develop such a thing?

Waiting for good reply...

Asif Javaid Chughtai.

asifjavaid 0 Light Poster

Hi all,
God Bless U,
Thursday, October 19, 2006
first i am writing the my problem again......:!:

i am facing a problem in SQL Server. I am have a table given below..
------------------------------------------------
Table name is "A"
------------------------------------------------
1 Michle Administrator
2 John Consumer Finance Officer
3 Jackson Employer
4 Goeffery Empl0yer
------------------------------------------------
Here the identity column is the first one. Now if i delete the 2nd row the this table becomes like that
------------------------------------------------
Table name is "A"
------------------------------------------------
1 Michle Administrator
3 Jackson Employer
4 Goeffery Empl0yer
------------------------------------------------
Now i have an another table "B" having same structure (3 columns and first column is the identity column). Now if i move the all the data from table "A" to table "B" then the original seqeunce is distrubed the table "B" contains the data like this.

------------------------------------------------
Table name is "B"
------------------------------------------------
1 Michle Administrator
2 Jackson Employer
3 Goeffery Empl0yer
------------------------------------------------

but i need that what ever the first column is identity column but sequence of numbering must be same as the numbering in the table "A" to preserve the relationships.... like that...

------------------------------------------------
Table name is "B"
------------------------------------------------
1 Michle Administrator
3 Jackson Employer
4 Goeffery Empl0yer
------------------------------------------------
:?:
Notice:- I am moving data from Table "A" to Table "B" using …

asifjavaid 0 Light Poster

Hi all,:confused:
God Bless U,
i am facing a problem in SQL Server. I am have a table given below..
------------------------------------------------
Table name is "A"
------------------------------------------------
1 Michle Administrator
2 John Consumer Finance Officer
3 Jackson Employer
4 Goeffery Empl0yer
------------------------------------------------
Here the identity column is the first one. Now if i delete the 2nd row the this table becomes like that
------------------------------------------------
Table name is "A"
------------------------------------------------
1 Michle Administrator
3 Jackson Employer
4 Goeffery Empl0yer
------------------------------------------------
Now i have an another table "B" having same structure (3 columns and first column is the identity column). Now if i move the all the data from table "A" to table "B" then the original seqeunce is distrubed the table "B" contains the data like this.

------------------------------------------------
Table name is "B"
------------------------------------------------
1 Michle Administrator
2 Jackson Employer
3 Goeffery Empl0yer
------------------------------------------------

but i need that what ever the first column is identity column but sequence of numbering must be same as the numbering in the table "A" to preserve the relationships.... like that...

------------------------------------------------
Table name is "B"
------------------------------------------------
1 Michle Administrator
3 Jackson Employer
4 Goeffery Empl0yer
------------------------------------------------

waiting for ur responce. i will very thankful to you by giving me effecient and excellent solution.
Thanks....
God Bless u By all means.;)

***********************************************************
***********************************************************

asifjavaid 0 Light Poster

Hi all,:confused:
God Bless U,
i am facing a problem in SQL Server. I am have a table given below..
------------------------------------------------
Table name is "A"
------------------------------------------------
1 Michle Administrator
2 John Consumer Finance Officer
3 Jackson Employer
4 Goeffery Empl0yer
------------------------------------------------
Here the identity column is the first one. Now if i delete the 2nd row the this table becomes like that
------------------------------------------------
Table name is "A"
------------------------------------------------
1 Michle Administrator
3 Jackson Employer
4 Goeffery Empl0yer
------------------------------------------------
Now i have an another table "B" having same structure (3 columns and first column is the identity column). Now if i move the all the data from table "A" to table "B" then the original seqeunce is distrubed the table "B" contains the data like this.

------------------------------------------------
Table name is "B"
------------------------------------------------
1 Michle Administrator
2 Jackson Employer
3 Goeffery Empl0yer
------------------------------------------------

but i need that what ever the first column is identity column but sequence of numbering must be same as the numbering in the table "A" to preserve the relationships.... like that...

------------------------------------------------
Table name is "B"
------------------------------------------------
1 Michle Administrator
3 Jackson Employer
4 Goeffery Empl0yer
------------------------------------------------

waiting for ur responce. i will very thankful to you by giving me effecient and excellent solution.
Thanks....
God Bless u By all means.;)